open gl

Started by
5 comments, last by Khaosifix 19 years, 5 months ago
I am designing a asteroids/space invaders game with wire frame space ships using open gl. I have two space ships drawn on the screen but they overlap each other, I want them to move independtly with keyboard interaction, I am using gl_line_strip and some function (renderscene) calls, I am very new to open gl and could use any help I can get, thanks
Advertisement
What is the problem, specifically?
i want to draw two space ships on the screen independent of each other, using open gl I want to interact with them using the keyboard
Phil,

No offense, but that seems less like a simple question and more like a "how do I write a game". Its going to be very tough to get anyone to answer such a broad question.

With that being said, I'll give you an overview. First, OpenGL is strictly a rendering api and has nothing to do with user input. You'll need to use either the standard win32 api or DirectInput if you want to capture keyboard/mouse events.

As for rendering multiple ships. You need to send the ship to the renderer multiple times. Each time you set a different world transform matrix. In doing this, the renderer will draw it in a different location.

Beyond the above, the rest is really part of being a solid C++ programmer. Divide and Conquer. Take larger problems, break them up into smaller problems, and then solve them one step at a time.

Good Luck!
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints
What about openIL? :-p (to the OP, openIL is not related to openGL at all, just in name and most likely shares openGL's procedural style)

(you know what would be cool? if openAL, openGL, openIL came together to make somewhat of a competitor for ALL of DirectX)

anywho... that was useless...

-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Quote:Original post by Ademan555
(you know what would be cool? if openAL, openGL, openIL came together to make somewhat of a competitor for ALL of DirectX)
you forgot SDL for user input and threading </offtopic>
anyway, as jwalsh said, you should ask a more specific question, maybe ask many questions, just make them more specific than "how do I make a game?"(btw, OpenGL is for graphics ONLY, no input, try using a library like SDL or GLUT and OpenGL together)
Dan, wtf?

Oh and SDL uses DirectDraw when being ran on a Windows environment. Ya dig?
---http://www.michaelbolton.comI constantly dream about Michael Bolton.

This topic is closed to new replies.

Advertisement