Original Post
🔒 Locked
Back Buffer
Advertisement
Opengl Defaults so that the back buffer is drawn into. you can use glDrawBuffer(mode) to set the buffer you want to draw into. I''m pretty sure that you can''t directy write to the back buffer (i.e. grab the memory location of the buffer and write to it) I think somebody as asking this a few weeks ago and the reply said that gl can''t assume the location of the framebuffer or else it would have to violate the platform independence of Opengl. As for the quads and render using screen coordinates you should be able to use and orothgraphic projection as opposed to a perspective projection. you can then specify all your coorindates in screen cooridnates.
void GlPushOrthographicProjection(float xValue, float yValue)
{
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0.0, (GLfloat) xValue, 0.0, (GLfloat) yValue);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
}
void GlPopOrthographicProjection()
{
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
void DrawText()
{
GlPushOrthographicProjection(640, 480); //setup for 2d rendering
drawText("Hello There", 10,10); //draw text at position 10, 10 of the screen
drawRect(10,10, 30,30); //lower left and uper right position of rect
GlPopOrthographicProjection();
}
"That''s more or less how it is done in NeHe''s tutorials. I was just too lazy to write it "
Sorry I didn''t even realized u had posted, it was a few minutes from the time i hit the reply button to the time i sent the message, so i didn''t see your post up there. I''ll have to type faster next time
Sorry I didn''t even realized u had posted, it was a few minutes from the time i hit the reply button to the time i sent the message, so i didn''t see your post up there. I''ll have to type faster next time
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement