Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

2d drawing api

Started by dawidjoubert 3 replies 600+ views
Original Post
dawidjoubert
dawidjoubert
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)
----------------------------http://djoubert.co.uk
wyled
wyled
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
---John Josef, Technical DirectorGlass Hat Software Inc
dawidjoubert
dawidjoubert
mm, u must have mis understood.

I was looking for suggestions on what to use if i plan on rendering alot of 2d shapes like TURBO CAD does
----------------------------http://djoubert.co.uk
wyled
wyled
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.
---John Josef, Technical DirectorGlass Hat Software Inc
Kambiz
Kambiz
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.