Hi!!
Im new to OpenGL and didnt found any way on other homepages tuts to change the default location of coordinates 0,0 from button left to top left :(
Second, I only want to use DrawPixel function to draw to the screen. I dont want any 3D stuff. But just a simple DrawPixel call with dimension of 500x500 and RGBA does take 850ms, even in release mode. 1000x1000 then already needs 2750ms...
Whats wrong? The window-creation is used from NeHe-Tutorials, and works just fine. All other code is made myself.
This code follows the window creation, which is a window-mode 32bit one.
ShowWindow(Window,SW_SHOW);
SetForegroundWindow(Window);
SetFocus(Window);
glViewport(0, 0, _Screen.m_Width, _Screen.m_Height);
glRenderMode(GL_RENDER);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, (GLdouble) _Screen.m_Width, 0.0, (GLdouble) _Screen.m_Height);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef (0.375, 0.375, 0.);
glLoadIdentity();
This code is in the window-handler:
case WM_PAINT:
{
glRasterPos2i(0, 0);
memset(m_pScreen->m_pData, 0xFF, m_pScreen->m_Height * m_pScreen->m_Width *4);
UINT Time = GetTickCount();
glDrawPixels(m_Screen.m_Width, m_Screen.m_Height, GL_RGBA, GL_UNSIGNED_BYTE, m_pScreen->m_pData);
UINT NeededTime = GetTickCount() - Time;
glFlush();
SwapBuffers(m_pScreen->m_DeviceContext);
return 0;
}
Whats wrong with the code?
Thanks guys!