Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Best API for simple graphics

This topic is 5152 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone. I''m planning what''s mainly an AI demo, but it needs to have graphics of some kind too. I basically need to draw a few thousand VERY simple objects (triangles, squares, crosses, etc.) It needs to run in some kind of pretty-standard Windows form, and I''d like to be able to pan around, zoom in, etc. It''s just strictly 2D, though. Any tips for a good API? Is GDI+ fast enough? I''ve played with OpenGL a little bit, but other than that I almost no graphics programming experience. I''d like to spend as little time getting the graphics code running as possible. Thanks for any advice.

Share this post


Link to post
Share on other sites
Advertisement
OpenGL is good and fast, but not surprisingly requires OpenGL to be installed. If you can be sure of that (most non-prehistoric computers are OK) then go with it.

Otherwise, use GDI. If that''s not fast enough, set up your own bitmap in memory, draw the objects manually, and use StretchDIBits() to copy your bitmap to the screen.

What sort of AI?

Share this post


Link to post
Share on other sites
Check out GLUT and OpenGL. You can have a fully functioning window with input and graphics in a matter of 20-30 lines of simple code. As a bonus it also then becomes pretty much platform independant.

Share this post


Link to post
Share on other sites
Anything after the Original version of Win95 will support not require you to install OpenGL.

quote:
Original post by fractoid
OpenGL is good and fast, but not surprisingly requires OpenGL to be installed. If you can be sure of that (most non-prehistoric computers are OK) then go with it.

Otherwise, use GDI. If that''s not fast enough, set up your own bitmap in memory, draw the objects manually, and use StretchDIBits() to copy your bitmap to the screen.

What sort of AI?


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
openGL is definetly the best choice

Share this post


Link to post
Share on other sites
Thanks for the input. Does OpenGL have some kind of 2D mode? I used OpenGL for a first person 3D program before (a virtual reality simulation of the ENIAC), and I'm thinking that the 3D code would be overkill if there were some simple "2d mode."

The program itself is going to be my big senior project for college. It's going to be a hunter-gatherer simulation/game. It will have a few populations of people with a few (probably a hundred or so) hereditary traits. Players/researchers will be able to set the parameters of populations or individuals to answer interesting questions like, "What happens if we have two tribes, one of extreme racists and another of 'color-blind' people." and "Is government self-organizing in hunter-gatherer tribes?" It should be pretty interesting.

[edited by - manbot1 on April 12, 2004 10:54:44 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Manbot1
Thanks for the input. Does OpenGL have some kind of 2D mode? I used OpenGL for a first person 3D program before (a virtual reality simulation of the ENIAC), and I''m thinking that the 3D code would be overkill if there were some simple "2d mode."



when setting up opengl if you only want to draw in 2d instead of setting up a perspective mode you''d set OpenGL to Othographic mode and then use the version of the commands which only take 2 parameters (vertex2f for example)

Share this post


Link to post
Share on other sites
we use OpenGL for our 2D controls, very easy to use 2D (easier than 3D) ... and as a bonus, your 2D stuff can peacefully coexist with views of real 3D stuff.

The easiest way to think of it is, your 2D objects are all 3D objects with no width and the same z-value.

And honestly, OpenGL graphics are polygon based anyway (triangles mainly), which are purely 2D concepts (its just that OpenGL knows how to draw them according to their position in 3D space - but if they are on the same plane, and you use ORTHO mode, then it will look just like any other 2D graphics would).

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!