Sign in to follow this  
razorjack

A GDI like graphic library?

Recommended Posts

Hello I'm searching for a modern object oriented 2D/3D graphic library (in C++). The library must have a more or less similar interface structure like the microsoft GDI or like the graphical canvas in Half Life 2. I thought of an interface structure like this: - DX9 / OpenGL support - A "device context" like interface with render utils inside - Maybe render to texture support - Resource objects like bitmaps, models or sth. else I've tried to find something like. The problem is that the offer of different engines and graphical utils is too big to keep a view over that all. And I have no success to find a pure small graphic library without anything other than drawing operations. Can anybody suggest me something?

Share this post


Link to post
Share on other sites
I'm not a Windows programmer so I am not familiar with GDI but I think that most of the graphics primative plotting are available from OpenGL itself. If you want a 2D wrapper library you can look into hxRender to do most of the graphics drawing functions using OpenGL. To get all of the I/O functions and multithreading you'll need another library such as SDL or GLFW to get started on that.

DirectX 9 may have some similar facilities but the last time I looked into DirectX (which was version 8) it was missing hardware-accelerated line plotting. I read the book Tricks of the Windows Game Programming Gurus by Andre LaMothe and it was rather helpful for learning some DirectX programming but that book is rather dated.

None of the libraries I mentioned are object-oriented but writing class wrappers for the functions you're going to use isn't a difficult task.

If you're looking for an engine instead of a library you can save a lot of time in your development. Some of those would include Irrlicht and Ogre3d for the 3d graphics plotting. (Both of which have backends for both OpenGL and DirectX IIRC.)

If you told us more about the project you were working on or why GDI didn't work for your existing project maybe we could help you more.

Share this post


Link to post
Share on other sites
I'm currently developing a 2D/3D SDK :)
The thing is that I'm using a wrapper for drawing operations to have a common interface.
I've decided to do it this way because I want to have a cross platform engine. I don't use GDI itself. But a GDI like wrapper has some comforts.
Okay^^ There are also some discomforts of GDI too.

I've written such a wrapper parallely, but I've currently no time to extend it. There are very much things to implement in the engine itself. So I thought of replacing my actual wrapper with a complete one.

Share this post


Link to post
Share on other sites
I'm sure that SDL and any number of add-on libraries (SDL_Image, SDLGfx, others) would come pretty close to what you're looking for. There are a number of related libraries defined over on http://libsdl.org/ which should suit your needs.

Not to mention, free (as in beer), LGPL licensing (for many), cross-platform, open-source...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this