Jump to content
xisto Community
Sign in to follow this  
Diffusr

C++ Graphics

Recommended Posts

Howdy McDoodlyhenks.Can anyone guide me towards a decent C++ graphics programming tutorial online? Any platform will do whether it's windows API or Linux GUI stuff. I just need to know how to plot pixels, change colours, draw primitives, you know , the basic stuff. I'm aware of the C library <graphics.h> but I want to go pure C++. Is there any alternative?I have googled for this myself but haven't found anything specific to C++ graphics programming so hopefully someone out here in WWW land will know a bit more than I do.Cheers and all that.

Share this post


Link to post
Share on other sites

Hi!

Pretty much all of the libraries I can think of are either C libraries or C++ wrappers over C libraries. Even the Microsoft Win32 API consists of C functions. I believe in some cases they won't work with C++ class methods (it's been a long time, but I specifically remember that there was a problem when I tried to pass a pointer to a C++ member function and an error was returned). I'm not sure of why you're avoiding C-based libraries and would like to know why you prefer to use a C++ library instead.

You might want to take a look at the ATL library, which is quite popular among C++ developers on the Microsoft Windows platform. From a quick Google search, I've found a tutorial on the Microsoft website at: https://msdn.microsoft.com/en-us/library/599w5e7x(VS.80).aspx

If you're open to the idea of using C libraries, you ought to try SDL (Simple DirectMedia Layer). It's available on both Windows and Linux - I've done all of my development on Linux so I can't tell you much about working with SDL on Windows. I'm sure it's almost the same on both platforms, except for the initial step of setting up the libraries and setting up the path for the compiler. If you think you would like to extend into 3D graphics, you should take a look at the OpenGL library, which is available on a multitude of devices from smart phones to computers.

Share this post


Link to post
Share on other sites

I'm aware of the C library <graphics.h> but I want to go pure C++. Is there any alternative?

graphics.h is borland specific library. It is not at all standard library. So your search for standard library ends. You need to find 3rd party libraries. Some of the libraries you can use SDL and openGL. You can even check the libraries used by game developers for graphics. You can check this page for graphics library. You'll find some of the libraries used in game development might help you with graphical program development.

But most of the time, you'll get your work done with either OpenGL or SDL library. Check google for opengl and sdl library tutorial. You'll get plenty of results. If you want to program platform specific graphics programs then MSDN is the place to ask for windows graphics program.

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  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.