DerelictGL program draw nothing
cal
callumenator at gmail.com
Mon Sep 3 11:45:05 PDT 2012
On Monday, 3 September 2012 at 17:16:54 UTC, Zhenya wrote:
> I added it to this code,but nothing changed(
Its a puzzler then, FWIW the following code works for me (I don't
use GLFW, I have my own window routines, but the opengl-specific
calls are the same).
Window("window1", WindowState(0,0,200,200), Flag!"Create".yes,
Flag!"Show".yes);
Window.makeCurrent("window1");
glViewport(0,0,200,200);
glClearColor(0,0,0,1);
bool finish = false;
while (!finish)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-200, 200, -200, 200, -1, 1);
glClear( GL_COLOR_BUFFER_BIT );
glBegin(GL_POLYGON);
glVertex2d(0, 0);
glVertex2d(0, 200);
glVertex2d(200, 200);
glVertex2d(200, 0);
glEnd();
Window().swapBuffers();
if (Window().keyState().keys[KEY.KC_ESCAPE])
finish = true;
}
Perhaps something in the GLFW init is modyfying some OpenGL
defaults or something, you might like to ask on their forum.
More information about the Digitalmars-d-learn
mailing list