Hello again Knighty :)
First off, thanks for the help on my previous question, I'm sort of progressing, learning new things every day.
Now, glGenTextures. I'm loading my "starmap.tga" and my "globe.tga" with glGenTextures(2, &texture[0].texID), that is why I thought I could generate three textures with glGenTextures(3, &texture[0].texID). When reading the specification for glGenTextures I read: "glGenTextures returns
n texture names in textures. There is no guarantee that the names form a contigous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to glGenTextures."
This led me to believe that I could generate the amount of textures needed by simply adding more to this call.
How should I go about adding more than one texture? Call several separate glGenTextures?
And now for the OT question. The code I supplied earlier has now been revised some. I've removed the posCursor function completely and am now sending g_mouse straight to the drawMouse function.
The g_mouse->mouseNoOldX and g_mouse->mouseNoOldY are the mouse positions without removal of the old position. I do this for rotating the scene.
In my CALLBACK functioncase WM_MOUSEMOVE: window->mouse->mouseMoving = true; window->mouse->mousePosX = (LOWORD(lParam)-oldPosX); window->mouse->mousePosY = (HIWORD(lParam)-oldPosY); window->mouse->mouseNoOldX = LOWORD(lParam); window->mouse->mouseNoOldY = HIWORD(lParam); oldPosX = (LOWORD(lParam)); oldPosY = (HIWORD(lParam)); return 0;
I'm thinking of removing windowed mode, since the only benefit of that is that I can run the program easily without having to into fullscreen every time. It's not something I have planned for the finished game anyway.
It's still bugging me though and I'd like to know why the quad is behaving the way it is. Is it because of the start bar in Windows Vista? Is it pushing the quad upwards?
Thanks for taking the time to answer (again),
Marcus
EditOkay, following Knighty's recommendations I wrote my glGenTextures this way instead of
glGenTextures(2, &texture[0].texID)
glGenTextures(1, &texture[0].texID);glGenTextures(1, &texture[1].texID);glGenTextures(1, &texture[2].texID);
It's working but I don't know if it's the best way to do it. Right now I'm using only 3 textures, but as the scene grows I guess I have to do some kind of loop instead.
I've also removed the windowed/fullscreen option and now the game will only run in fullscreen in the requested resolutions, this fixed the problem with the moving quad.
I've also started texturing the mouse pointer with a TGA with an Alpha value. Lack of knowledge rears it's ugly head again as I can clearly see the Alpha working correctly (removing the background from the image), but the black quad that I'm binding the texture to is now showing. Giving me less than great results.
The pointer is looking good though. :)
Anyone have any tips? Either on what to read or details on how to go about it? It'd be appreciated.
I changed the title of the thread to better reflect the content.Thanks for all the help I've been getting here. I'm new to this kind of programming. But I am learning and I've recently bought the "Beginning OpenGL Game Programming" book and the follow up, "More OpenGL Game Programming". Really great books.
[Edited by - tre on April 27, 2009 10:53:31 AM]