There aren't any libraries that are better suited to what your stated requirements at the top of this thread are than plain old OpenGL. Making a routine to draw a rectangle in OpenGL is not considered reinventing the wheel -- it's pretty basic and only takes a few lines. Trying to stack another library on top isn't going to help for your project. Annoying as it may seem, maybe you should take a stab at it. Start at http://nehe.gamedev.net/ to find the basics you're looking for.

Quote:Like I said, I don't want to reinvent the wheel, and these seem like such basic things, though the setup to do them in OpenGL is annoying enough that a 2D OpenGL library ought to exist.

and

Quote:I just want to make sure I'm not going to be reinventing the wheel before I go at it.

then:

Quote:Writing a routine that draws a rectangle? That seems to me a bit like reinventing the wheel.

I say, wtf are you asking about reinventing the wheel then, eh?
You are not reinventing the wheel because everyone in the world isn't going to start using your design, its just something you should get done asap so you can do somthing more interesting and non trivial sooner.

jab630 Wrote:Writing a routine that draws a rectangle? That seems to me a bit like reinventing the wheel.

But you're not doing that, you're writing a routine which calls an API call to draw a rectangle, and you're giving it the specifics of that rectangle, such as it's texture, position, size, place of each vertex etc. The wheel has already been invented, and what you're doing is utilising it.

The only things you're doing that will require writing any much code at all are images and circles. You should be able to use some trig you learned age 14 to do the circle in 10 minutes. That only leaves images, and yes, there are plenty of third-party libraries for loading images. Which one you choose will depend on your requirements.

Quote:You should be able to use some trig you learned age 14 to do the circle in 10 minutes.

How would you code a circle? personally i woud just take a big circle bitmap and then scale it at the right size. Otherwise use a gluDisk.

if not what, draw it "by lines"? (calculate the left_x and the right_x for every y and draw the horizonta line?) That would work in a "pixelated" enviroment, but wouldn't fit nicely in the more "abstract" opengl setting. Or just replicate a gluDisk?

The circle bitmap might be the right approach, but depending on the size variation of the circles, you might have to do some funky stuff to use different resolution textures.

The "obvious" way to do it with geometry is to draw it with a single TRIANGLE_FAN -- put the initial point in the center of the circle, and calculate some number of points around the circumference using basic trig.

Here, I wrote the library. You have to provide the OpenGL context. You also have to provide the image loading, which is noted in the source. Then simply call INIT once at startup, and call UPDATE every frame, giving it the bounds of your GL context. I didn't spend even one brain-cycle on doing *any* optimizations -- It's all brute force here ;-) There are probably a whole bunch of mistakes in there too, but I tested it minimally and it works just fine as far as I can tell.

If somebody sees something that really bothers them or they'd like to add to it, or change it, then feel free to knock yourself out ;-) Maybe actually code the circle function using something other than gluDisk as I did. Maybe write a silly little texture loader? Whatever, have fun with it...

AnotherJake:
Thanks for going above and beyond. I'm actually going to stick with SDL for the following reasons:
- The graphics I'm doing are so simple that it will be plenty fast enough.
- The most important thing is that this be simple and straightforward to maintain since I'm graduating this semester and the people who will be using it don't have that much programming experience and no OpenGL experience.
- Someone on gamedev.net just told me about sdl_draw (http://sourceforge.net/projects/sdl-draw/), which is exactly what I'm looking for.

jab630 Wrote:AnotherJake:
Thanks for going above and beyond. I'm actually going to stick with SDL for the following reasons...

Sure, no problem. I was under the impression that you were looking for speed, so I figured I'd demonstrate just how easy it is to do with OpenGL. It's less than 300 lines including the header -- maybe only fifty of which have anything to do with OpenGL. But anyway, hey, if you think you've found a better way to suit your needs, then by all means, rock on!