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.
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.
John Davis
>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.
Levi Thompson
Just use pixi.js on top of WebGL on top of OpenGL or Godot, if you hunger for the 2D GL experience.
Charles Clark
vomit
Tyler Taylor
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.
So is C, but still it's what OP wants, apparently.
Jacob King
That being said, there is no good 2D higher level library that is still lowlevel enough for shader effects.
Zachary Barnes
Elysian Shadows
Jacob Butler
>mfw I went here to see some nice projects but instead had to riddle myself with these intellectual replies
Cooper Green
Chip8 emulator if you're also interested in emulation
Robert Gutierrez
>C only It looks like you'd been influenced by /dpt/-pajeets.
Adam Powell
>C >pajeet
Dominic Torres
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.
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.
Jace Clark
i'm using webgl for university. don't have any clue what's happening there
Alexander Gray
t. pajeet
Asher Moore
WebGL is an abomination
Juan Kelly
literally the same as opengl with some variations in functions
Easton Taylor
>It's not like there is a direct replacement for C. True, there is no competitor for incomplete brainlet languages for systems programming.
Chase Morgan
The only reason C isn't used by pajeets is that there aren't that many C jobs.
Xavier Ward
It's OpenGL from javascript an abomination
Jayden Williams
If anyone could post some useful PDFs or books that build a game step by step i would really appreciate it, thanks!
Zachary Adams
I have another question. Is 2D on GPU even worth it or are CPUs on Mobile and Desktop fast enough for aestehtically pleasing games?
Landon Miller
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.
Zachary Martinez
both you dont NEED to use OpenGL for 2D but it makes alot of things much easier like rotation and scaling