#160135 - BenRK - Thu Jul 10, 2008 8:07 pm
I'm having problems using OpenGL in a project of mine. I want to move stuff around on the screen by pixels (not by the leaps and bounds that floats do), but I haven't found any apparent standard in the OpenGL functions to get the translation to not use floats. So, I tried applying the changes in the y value to the quad it self, but nothing on the screen moved at all. So, either changing vertex coordinates in real time is not possible with out a translation, or my screen isn't refreshing for one reason or another. So, I've come here for help.
_________________
EvolitesDS - Possibly coming out some day... maybe...
Code: |
while (1)
{ if (keysHeld() & KEY_UP) { camy--; } //ds specific, several attributes can be set here glPolyFmt(POLY_ALPHA(31) | POLY_CULL_NONE); // Set the current matrix to be the model matrix glMatrixMode(GL_MODELVIEW); //Push our original Matrix onto the stack (save state) glPushMatrix(); glBegin(GL_QUADS); glColor3b(37,69,150); glVertex3v16(0,camy,0); glColor3b(36,68,149); glVertex3v16(256,camy,0); glColor3b(11,118,193); glVertex3v16(256,600+camy,0); glColor3b(12,119,194); glVertex3v16(0,600+camy,0); glEnd(); // Pop our Matrix from the stack (restore state) glPopMatrix(1); //a handy little built in function to wait for a screen refresh swiWaitForVBlank(); // flush to screen glFlush(0); } |
_________________
EvolitesDS - Possibly coming out some day... maybe...