Game Lesson #1 Help
i have made many game but i am trying to use you wraper function but i cant get it to work.
Where in the Game Main do i draw triangle if i wanted to?
sinput.DInput_Update();
if(KEY_DOWN(DIK_ESCAPE))
PostQuitMessage(0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
GetClientRect(hwnd,&window);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0,window.right,0,window.bottom,1,-1);
glMatrixMode(GL_MODELVIEW);
glColor4f(1,1,1,1);
s3d.glPrint(240,450,"ShiningKnight");
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
SwapBuffers(hdc);
return true;
I have tried everywhere. thanx for the help
~Holographic
sinput.DInput_Update(); if(KEY_DOWN(DIK_ESCAPE)) PostQuitMessage(0);glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glLoadIdentity();GetClientRect(hwnd,&window); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho(0,window.right,0,window.bottom,1,-1); glMatrixMode(GL_MODELVIEW); glColor4f(1,1,1,1);s3d.glPrint(240,450,"ShiningKnight"); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glLoadIdentity();//DRAW STUFF HERESwapBuffers(hdc); return true;
Those who dance are considered insane by those who cannot hear the music.
quote:
Original post by Holographic
i have made many game but i am trying to use you wraper function but i cant get it to work.
Where in the Game Main do i draw triangle if i wanted to?
Hola!! Out of curiosity, I decided to test out the game code also. Anyhow, after about 3 hours of annoyance I finally figured out (our) problem. There is something messed up with the s3d.Font_Init(); function. After executing this function, you can no longer draw to the screen. I looked at the init function and it looked pretty clean, so I have no clue what the problem is. If somebody else would look at that it would be great. Anyhow, take out the s3d.Font_Init(); and obviously the shutting down of the font, and the wrapper works quite excellently.
Actually, there are a couple of other bugs. Namely, you can''t start a program in WINDOWED mode by default, by just using the WINDOW definition, since its never accessed in the ShiningKnight.cpp file, but that''s easy to fix. Also, you need to add a declaration for the / operation if you are using the vertex class, it is left out of the VECTOR3D class definitions, but that''s also easy to do.
Hope that helps.
The font bug is because the font binds the font texture, but never unbinds it. So do a glBindTexture(GL_TEXTURE_2D, NULL); after drawing fonts and before drawing other stuff.
CUselessStuff::NiftyQuote();
CUselessStuff::NiftyQuote();
Super Sportmatchen - A retro multiplayer competitive sports game project!
or bind your own texture or just disable it by calling glDisable( GL_TEXTURE_2D );
There are more worlds than the one that you hold in your hand...
There are more worlds than the one that you hold in your hand...
You should never let your fears become the boundaries of your dreams.
I''m going to be redoing all of the previous tutorials (except for #7) sometime in the next three months, and once they have all been redone, I''m going to start on some new ones! So, just to make it known, the series is NOT dead... I''ve just been so bloody busy lately.
Trent (ShiningKnight)
THE Engine
trent@voxelsoft.com

Trent (ShiningKnight)
THE Engine
trent@voxelsoft.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement