Graphics

Pages: 123... 5
Hello, I am looking for a good website to learn graphics with C++? And could someone even tell me what is the best to start with, i've tried something with OpenGL, but I need something to come with Win32 desktop apps
Direct2D and DirectX seem to be the standard graphics APIs in windows. Here is an overview of Direct2D from MSDN:

http://msdn.microsoft.com/en-US/library/windows/desktop/ff684175%28v=vs.85%29.aspx
closed account (9wqjE3v7)
GDI, GDI+, Direct2D if you are not thinking of doing any graphics intensive work and just need a UI design.
DirectX, OpenGL, Direct2D if you want to learn graphics for things such as gaming and scientific applications - modern hardware.

closed account (3qX21hU5)
I would highly suggest you stay away from the the very low level librarys like GDI/GDI+, DirectX, OpenGL, ect when you are just starting out with learning graphics programming or GUI programming.

Instead go for something that is a lot simple to learn and get your head around first. Once you get the general idea behind graphics programming or GUI programming you can then start to tackle the beasts of DirectX and OpenGL.

For example here is a few good choices for each of the subects.

Graphics

SFML - http://www.sfml-dev.org/
SDL 2.0 - http://www.libsdl.org/download-2.0.php
Allegro - https://www.allegro.cc/

GUI Development (Graphical desktop applications)

QT - http://qt-project.org/
wxWidgets - http://www.wxwidgets.org/


Those are only a few and there are many more out there. But it gives you a place to start and do some research. Also I would like to note that the graphics libraries I mentioned are only for 2D and if you want to do 3D graphics you will need to learn OpenGL to do so.
Last edited on
closed account (N36fSL3A)
I would suggest staying away from dx.
Last edited on
closed account (9wqjE3v7)
I personally wouldn't call GDI/GDI+ very low level, there is certainly a lot of abstraction already.
Last edited on
i personally would suggest SFML (2.0) as i tried SDL and had trouble with it however that could be because i didn't look at video tutorials as i did with SFML (i used coding made easy c++ sfml 2.0 tutorials). SDL was mainly used in the C language however SFML seems to be better associated with C++ so it depends on which language you are using
closed account (N36fSL3A)
I find SDL much easier to learn that SFML.
But is the extra effort worth it in the long term?
closed account (3ARE3TCk)
Valve does all of their Steam/Source development for Linux using SDL and recommend it as the best way to make games for Linux, so there's that.
closed account (S6k9GNh0)
They use SDL as a cross-platform OGL context and windowing/event library. They dont' use it's drawing API to make things clear.

EDIT: I can suggest OGL but it always gets shot down. OGL is often made out to be quite a bit more difficult than it actually is....
Last edited on
I learnt OpenGL long before I used anything else. Its really not that hard, and the only reason that people would use other libraries is because of a few features they add that OpenGL doesn't add (being a graphics-only library), such as (but not limited to):

- Image Loading
- Operations for initializing a window
- Sound
- Keyboard and Mouse input

However, there are plenty of cross-platform libraries out there for doing just those tasks, such as SOIL for loading images, GLFW or GLUT for window creation and user input, and OpenAL or IrrKlang for sound.

The only real disadvantage to OpenGL is that often somethings require a bit of knowledge of linear algebra, and require a few more lines of code to do.
It also has an API that works in an odd way to most programmers.
closed account (3qX21hU5)
The only real disadvantage to OpenGL is that often somethings require a bit of knowledge of linear algebra, and require a few more lines of code to do.


I also wouldn't say using openGL compared to something like SFML is "only a few more lines of code". Depending on the size of the code it is a a lot more lines of code and more importantly a lot more work and designing.

The only time where I could see it not really making much of a difference is in larger projects and small "example/demo" projects (Like drawing a circle on screen, or something along those lines). But larger projects most likely wouldn't use a library like SFML or SDL.

The hardest hit would probably be Indie projects which are small to mid sized projects and if they used straight openGL the development time would go up quite a lot.

Most of the time for small 2D projects like people do on this forum openGL really isn't the best option available. Specially when the wrappers like SFML and SDL can do almost anything you need to do with much less work (And for the times you do need openGL you can easily use it with both libraries). For small games I see no real incentive to use openGL over SFML or SDL.

Last edited on
closed account (N36fSL3A)
SDL actually uses DX for rendering...
closed account (3qX21hU5)
SDL actually uses DX for rendering...

Not always...

If you are on windows yes it can use GDI and DirectX for the back end but I don't see your point... I never mentioned anything about the back end of openGL (At least I don't think I did).
closed account (N36fSL3A)
Most of the time for small 2D projects like people do on this forum openGL really isn't the best option available. Specially when the wrappers like SFML and SDL can do almost anything you need to do with much less work (And for the times you do need openGL you can easily use it with both libraries).
From what I'm reading you're implying that SDL is a OpenGL wrapper.
From what I'm reading you're implying that SDL is a OpenGL wrapper.

Because It is?

It wraps other things as well (like the window manager, event queue, input, etc), but the graphics are just an OpenGL/DX wrapper.
closed account (N36fSL3A)
It uses Direct X as it's backbone. It isn't an OpenGL wrapper.

I read somewhere it uses DX 8 or something.
closed account (3qX21hU5)
Like Disch said it is a wrapper around openGL. Also the part you quoted was pointing out that SDL and SFML provide contexts which you can use openGL with.
Pages: 123... 5