PDA

View Full Version : Drawing rectangles



electricate
06-18-2002, 08:08 AM
I need to plot a diagram with more than 30,000 rectangles with embedded text and inter-linked by lines. There are also zoom and pan operations to be implemented on this diagram. Is OpenGL the right package to use? How would it compare with GDI?
Thanks

nexusone
06-18-2002, 09:28 AM
In someway's openGL would be more flexible, when doing a zome and scale operation.
You should look at some openGL applications and tutors to help you make up your mind



Originally posted by electricate:
I need to plot a diagram with more than 30,000 rectangles with embedded text and inter-linked by lines. There are also zoom and pan operations to be implemented on this diagram. Is OpenGL the right package to use? How would it compare with GDI?
Thanks

AdrianD
06-19-2002, 04:19 AM
With OpenGL u can:
- draw antialiased lines/rectangles
- draw textured-triangles
- do fancy lighting effects
- do shadows (ok, this is a "little bit" more advanced)

...but you can't do any textoutput.


With GDI yuo are happy, when you get some colored lines on the screen (of course only with one color). But the textoutput if (of course) much more better (or let me say: "is there")

my suggestion:
use openGL for geometry mixed with GDI for textoutput (you should create an offscreen DIB and draw your text into it, and then copy it into a texture... there are several tutorials on the web, describing how to do it)

Omaha
06-21-2002, 08:19 AM
Actually, if you use wglUseFontBitmaps, you can easily implement text in your OpenGL code. OpenGL wins http://www.opengl.org/discussion_boards/ubb/wink.gif