Suggestions for Shining3D...

Started by
-1 comments, last by Krisc 21 years, 4 months ago
In the first tutorial code, I noticed that the glPrint function was quite basic so I added a new functionality to it which I had with similar Text functions in VB and DirectX. I added a color functionality, to eliminate code being written in the call part. Basically, it is like this: GLvoid engine::glPrint(GLint x, GLint y, const char *string, int red, int green, int blue, ...); then at the end of the actualy function, I modded it to be like this... // Set the color glColor4f(red,green,blue,1); glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws The Display List Text glPopMatrix(); // Restore The Old Projection Matrix // Unset the color glColor4f(1,1,1,1); and finnally, the call to the function looks like this (for red text) s3d.glPrint(425,750,"Unknown Soldier",1,0,0); basically, it takes in a rgb value uses it and then sets the color back to normal after using it...i decided to post here because with game engines it is important to keep the code down and modularity up...so I think you should add this bit to the tutorial... =)

This topic is closed to new replies.

Advertisement