Modern OpenGL, 2D

Post your 2D OpenGL projects here!

I'm looking for some information about using OpenGL 3 for 2D games, preferably C only. I'd really love to write something like Terraria using modern OpenGL, however everything I could find was very basic stuff without batching or with fixed pipeline.

So if anyone has good sources or wants to show of some of their projects, go ahead.

Other urls found in this thread:

github.com/baldurk/renderdoc
twitter.com/AnonBabble

It seems OpenGL is used for 3D graphics almost exclusively. While you can do 2D with it too obviously, no one really seems to bother with it.

>While you can do 2D with it too obviously, no one really seems to bother with it.
Because you just need to implement your 2d vector drawing library and then use that.
Usually the window library / GUI already provide functions for 2D drawing so there's no need to reimplement them again in opengl.

Just use pixi.js on top of WebGL on top of OpenGL or Godot, if you hunger for the 2D GL experience.

vomit

True, but not only will he develop faster, the end result will also be faster due to all the shittons of fallback stuff for faulty drivers OP won't have to make.

Also, OP uses C, so he is in for that anyway.

Why not Vulkan fampo

Use renderdoc to see what's habbening
github.com/baldurk/renderdoc

OpenGL is obsolete

So is C, but still it's what OP wants, apparently.

That being said, there is no good 2D higher level library that is still lowlevel enough for shader effects.

Elysian Shadows

>mfw I went here to see some nice projects but instead had to riddle myself with these intellectual replies

Chip8 emulator if you're also interested in emulation

>C only
It looks like you'd been influenced by /dpt/-pajeets.

>C
>pajeet

What else then isn't obsolete? It's not like there is a direct replacement for C.
If I didn't want to keep things low level, I would have aked for an engine and a language with a nice big stdlib like Golang.

I have absolutely no problem using Vulkan, but finding 2D stuff for that is even harder.

>github.com/baldurk/renderdoc
Thank you that's exactly what I needed.

SDL drawing is also nice I guess

He was influenced by powerusers

I'm working on a openGL/glfw/c++ doom clone that loads wads and put them into place and plays then just like the original. The only problem I've run on so far is trying to figure out how to integrate collision ( even though the original didn't have that I believe) so that when I shoot it traces a Ray and checks for any object that had collided. I based most of my information in bisqwit's doom engine in BASIC but the main difference being that instead of doing a perspective looking 2 1/2D openGL draws fully the geometry with triangles, allowing for the total view of whatever object there is. As for the enemies and objects in the game I load a 2D transparent BMP spirte and change the sprite everytime something changes, I.E a barrel explodes. But for now I'm still learning how to do things in GL.

Eventually I hope to move to something easy like a danmanku touhou-ish openGL game just being a 2d sprite shooting balls in patterns and adquiring upgrades.

i'm using webgl for university. don't have any clue what's happening there

t. pajeet

WebGL is an abomination

literally the same as opengl with some variations in functions

>It's not like there is a direct replacement for C.
True, there is no competitor for incomplete brainlet languages for systems programming.

The only reason C isn't used by pajeets is that there aren't that many C jobs.

It's OpenGL from javascript
an abomination

If anyone could post some useful PDFs or books that build a game step by step i would really appreciate it, thanks!

I have another question.
Is 2D on GPU even worth it or are CPUs on Mobile and Desktop fast enough for aestehtically pleasing games?

Absolutely. I think you are misunderstanding something. Even if you use some framework that is made for 2D use, it's using the same graphics hardware and apis in the background as 3D games do. Not using gpu would mean using software rasterizer, that would be dumb.

Writing your own software rasterizer or raytracer is a good exercise btw. Doesn't take much time but help you understand things much more clearly.

both
you dont NEED to use OpenGL for 2D but it makes alot of things much easier like rotation and scaling