Creating a Renderer within my OpenGL 3.0 context (SDL2) |
Re: Creating a Renderer within my OpenGL 3.0 context (SDL2) |
AlexRou
|
Instead of doing it that way, why not render the rects in openGL without the renderer?
If you want it to be drawn as flat 2D on top of 3D you can do like (note the following is in opengl 2): 3D draw loop(); glViewport( 0, 0, WindowWidth, WindowHeight ); /* change to the projection matrix and set our viewing volume. */ glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho( 0, w, h, 0, -1, 1 ); /* Make sure we're chaning the model view and not the projection */ glMatrixMode( GL_MODELVIEW ); /* Reset The View */ glLoadIdentity(); glPushMatrix(); 2D draw loop { glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); draw lines } SDL_GL_SwapWindow( m_Window );
|
|||||||||||||
|