Jump to content
  • Advertisement
Sign in to follow this  
dawidjoubert

OpenGL 2d drawing api

This topic is 4676 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, i love opengls method of drawing things. However i had this idea for a windows (2d) project and i was wondering whats the best way to render lines and pixels and stuff. It needs to run in window mode and with other windows and stuff. I have seen SDL provides nice 2d editing but i need something which also offers me to transform all inputs by a matirx (or atleast translation)

Share this post


Link to post
Share on other sites
Advertisement
A way to draw a line in opengl...

Here is some C# reference, even though I don't like C# it still applies to most other languages just without the OOP-ness.

http://www.c-sharpcorner.com/Code/2002/Oct/OpenGLBasics.asp

Share this post


Link to post
Share on other sites
Well I would definitely use OpenGL, it is much faster than using the SDL api directly. You can use SDL still for things like input - and extentions like SDL_image for loading image data.

Share this post


Link to post
Share on other sites
I would use something like Anti-Grain Geometry or even GDI or GDI+ for a CAD program. I think the quality and accuracy(even subpixel accuracy) are really impotent in a CAD program. OpenGL can draw really nice anti-aliased lines(but without subpixel accuracy) but it can not draw a perfect circle like the other APIs.
If you need to draw thousands of lines in realtime(say with 30fps) then OGL is the right thing. But a CAD program does not need to rerender everything 30 times pro second. So by using Anti-Grain Geometry you will get the most beautiful results.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!