Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void OpenGLManager::RenderScene()
- {
- // Testing testing
- ALLEGRO_BITMAP *rBitmap = GlobalVariable::SharedGlobalVariable()->mBitmapLibrary->GetBitmap("WoodCorner");
- if(!rBitmap)
- {
- fprintf(stderr, "Rendering failed, couldn't find Grass\n");
- return;
- }
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glBindTexture(GL_TEXTURE_2D, al_get_opengl_texture(rBitmap));
- glEnable(GL_TEXTURE_2D);
- //Set up perspective projection
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- SetPerspective(45.0f, (GLfloat)800.0 / (GLfloat)600.0, 0.1f, 100.0f);
- // Do your 3D stuff
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0, 0, 0);
- //glRotatef(mCounter*36, 1, 1, 1);
- glBegin(GL_QUADS);
- glTexCoord2f(0, 0); glVertex3f(-10, -10, 0);
- glTexCoord2f(1, 0); glVertex3f(+10, -10, 0);
- glTexCoord2f(1, 1); glVertex3f(+10, +10, 0);
- glTexCoord2f(0, 1); glVertex3f(-10, +10, 0);
- glEnd();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- }
Add Comment
Please, Sign In to add comment