Advertisement

Where to start OpenGL for a project like this?

Started by December 28, 2017 12:07 PM
5 comments, last by cgrant 7 years, 1 month ago

Hi,

I'm learning about creating 2D games with SDL, but I want to learn OpenGL too, because it can give a much higher quality to the graphics, and also SDL supports the use of OpenGL at the same time. I want to keep making 2D games for a while because I feel that I still have a lot to learn about programming itself, so I don't want to jump into 3D this early (I'll learn 3D in school later btw). The game ideas that I'm thinking about at the moment would require a graphics quality like this:

" rel="external">

How hard is it to get to this level of OpenGL for a complet beginner, and could you recommend some useful sources (books mostly) that only deal with 2D problems?

Hi.

 

It's not hard to learn OpenGL. Trust me when I was beginning in graphics programming I thought OpenGL is really hard judging by the codes online. Yeah it might be little hard to draw you first triangle but the rest is easy.

 

I started learning graphics about a year ago. I could make a simple 2D game engine in 2 months. Here is my simple 2D game engine I made 7-8 months ago.

 

I highly recommend you to check learnopengl.com that's how I learned.

Wish you all the best.

Advertisement

OpenGL is a strange beast in that if you start off learning it the wrong way it will take you down a messy path. Following that comes the fact that you need to choose projects that are comfortable for your knowledge thus far of OpenGL, so if you find that you are cutting and pasting without not understanding, you are setting yourself up for trouble.

Where to start learning? It works out different for different people, I personally learned from countless sources where something would be explained better somewhere over others. Finding what works for you will also take some work.

 

20 hours ago, Robin04 said:

I'm learning about creating 2D games with SDL, but I want to learn OpenGL too, because it can give a much higher quality to the graphics, and also SDL supports the use of OpenGL at the same time

I definitely agree you should start with 2D, get things going make something small to learn from then you can expand from there.

SDL is very good, it is used in a lot of small and heavy duty games. But I did found it hard to find good material so I had to expand my horizons and look at the other OpenGL tool kits like:- glfw, SFML, LWJGL/Java and WebGL. 

Under the hood they all use OpenGL - so it all helped. I wanted example projects bigger than HelloTriangle and smaller than Doom3 - could not find much in-between. 

BTW of all of the OpenGL tool kits SDL is my favourite because it does mobile and it just works!

Anyway have a look at:

1. The example apps that come with SDL (or SFML, LWJGL or whatever).

2. http://www.lazyfoo.net/ - shows you how to setup on Windows, Mac, Linux, with and without mobile. 

There is no great architecture here, just example by example - but then you can take that knowledge and use it in your games.

3. https://learnopengl.com as mentioned here already. Uses glfw not SDL but it is a good site and there's a free book you can download.

4. http://learningwebgl.com/blog/?page_id=1217   (WebGL yes I know ... but still it is OpenGL under the hood and you can quick learn from those guys.  

Lots of stuff on YouTube but many of them take 100 videos just to make the most primitive game - it should only take about 10 vids not 100.

 

20 hours ago, Robin04 said:

How hard is it to get to this level of OpenGL for a complet beginner, and could you recommend some useful sources (books mostly) that only deal with 2D problems

Everything is easy once you know how.  

If you learn how one sprite based game works (like Space Invaders) you will realise they are all more or less the same. 

Good luck.

 

 

 

For 2D Lighting,you can search by google or github.Here is 2 examples

https://github.com/eXpl0it3r/LTBL

https://github.com/eXpl0it3r/LTBL2

And for tutorial,like the link above,learnopengl.com,good tutorial,yet you can always search all kind of beginner tutorial on youtube.

C,C++,Java,blahblah Language,

SDL,SFML,LWJGL,libgdx,Unity3D,Unreal4...ect,

and one tutorial I've seen mixed with SDL and Opengl is this

www.youtube.com/playlist?list=PLSPw4ASQYyymu3PfG9gxywSPghnSMiOAW

The only problem is it's too fxxking long tutorial,some eposide may have 1 or 2 hours,really need some patience.

If you are a busy guy,just check how to setup opengl in sdl,there are other video tutorials show you how to do this,just use youtube,

keep searching.

And there is nothing to be afraid of learning 3D,some 2D game effect may just use 3D knowledge,like triangle to make some cool 2D effect.And shader.

Just find beginner tutorial on youtube,follow it.

It's just time problem,you can learn almost every game programing basic knowledge,just keep searching youtube,google,github open source project.

And you will get there.

If you want to learn about graphics techniques, then you need to learn the basics about 3D graphics/rendering and not OpenGL. There is a lot of confusion as to the difference between an 'graphics' API and graphics techniques or graphics rendering API or graphics rendering. The two are NOT the same. OpenGL is just an API  and nothing more so if you want to learn OpenGL all you will end up learning is just how to interact with the API ( just making API calls ). However, what you do with the API is a whole different matter. Do not get hung up on a specific API as once you have the basic down however you choose to express what you've learn then become a matter or personal/business preference. Meaning, it will not matter what you use OpenGL, DX, Vulkan, Metal etc..they are all API and useless by themselves without direction, direction being the expert/not so expert application of graphics rendering/compute techniques.

This topic is closed to new replies.

Advertisement