[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What's a good and easy piece of OpenGL code I can cannibalise?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 34
Thread images: 15

What's a good and easy piece of OpenGL code I can cannibalise?
When in doubt it's a fairly effective way of learning, but although QuakeSpasm was in the perfect format it's pretty large and complex.
>>
File: 1400734247007.jpg (140KB, 918x832px) Image search: [Google]
1400734247007.jpg
140KB, 918x832px
>>56595298
>good
>easy
>openGL
choose two.
>>
>>56595443
Surely someone out there must have made a template though?
A template that just has a few things:
>creation of a window and an OpenGL context
>a good way to arrange your shaders
>handles user input
There's libraries for it, sure, but then if you ever need to tweak some fine detail, or you actually want to learn low level OpenGL, you're fucked.
>>
File: 1402976874753.jpg (327KB, 895x794px) Image search: [Google]
1402976874753.jpg
327KB, 895x794px
>>56595494
If you're okay with SDL2 here is something that might help you.
http://lazyfoo.net/tutorials/SDL/51_SDL_and_modern_opengl/index.php
>>
>>56595298
Low level OpenGL is hard, but usable. You'll need to write your own framework anyway.
Just look for libraries that will add some OOP and won't make you kill yourself unlike plain OpenGL.
>>
If OpenGL could be good and easy, someone would actually use it. Why do you think everybody uses Direct3D instead, OP?

But anyway, if you insist, here's a piece of code you can use. You'll probably understand what I mean once you see the code:

http://wiki.freepascal.org/OpenGL_Tutorial
>>
File: 1469494575105.jpg (195KB, 500x650px) Image search: [Google]
1469494575105.jpg
195KB, 500x650px
>>56595560
Ah, but first I need to get the hang of installing libraries in C.
Pity it's not justwerks like Java, where your Java libraries are Java files.

>>56595604
I forgot Direct3D existed.
How does it compare?
>>
>>56595631
>How does it compare?
It doesn't, OpenGL is literally in the stone age next to it. Why do you think OpenGL is dead in the water?
>>
>>56595728
Because OpenGL is being redone from the ground up as Vulkan, while Direct3D will remain an eternal clusterfuck just like Windows 10.
>>
File: 1463688382661.jpg (49KB, 423x389px) Image search: [Google]
1463688382661.jpg
49KB, 423x389px
>>56595631
If you don't know how to install/use a library it's probably a bad idea to jump into openGL or any graphics api for that matter.

Also no one creates an openGL context without a library. Even if you use the winapi that's still a library.
>>
>>56595786
>Vulkan
What is that but an admission of defeat?

>Direct3D
>eternal clusterfuck
You've obviously never written code for either.

I wish freetard fanboys would stop be so opinionated about everything without at least having the slightest bit of knowledge about it.
>>
>>56595896
>>Vulkan
>What is that but an admission of defeat?
>only freetards uses opengl
>>
how do u report sum1 for avatarfagging?
>>
>>56595922
Not even freetards use OpenGL actually, since they all have a separate Windows installation for gaming and/or 3D modeling.
>>
>>56595892
It's more of the fact that the instructions for installing the library are outdated, actually.
I'm being asked to put files in all sorts of folders that don't exist.
>>
File: 1400740780287.jpg (644KB, 1255x1924px)
1400740780287.jpg
644KB, 1255x1924px
>>56595976
You're on windows then, eh?
Ever heard of the PATH system variable?

>>56595930
all four of us?
>>
>>56595957
I don't even remember last Direct3D game I've played, even though I play on windows, linux and PS3 all the time.
Nowadays, every game engine supports both libraries and developers don't give a fuck. Direct3D is limited to Windows and xbox which makes it even less suitable for games. Unless you only play AAA on Windows.
>>
>>56596068

>every game engine supports both libraries
Not true at all.

>Direct3D is limited to Windows and xbox
That's the absolute majority of devices out there.

>implying other consoles use OpenGL
Nope. The PS3 uses PSGL. The PS4 uses GNM, GNMX and PSSL. Nintendo uses proprietary languages/APIs that you don't even hear about unless you're a gamedev and have access to the official SDKs.
>>
>>56596035
Managed to get it to work, simple enough once you realise that CodeBlocks expects all the stuff in one format which it will make clear to you.

But now it's saying "___ was not declared in this scope" for anything glfw related so I guess that didn't work out as planned.
>>
>>56596166
Correction: It's saying that about around half the glfw related things.
It complains about glfwOpenWindow, but not glfwTerminate.
>>
File: cringe.jpg (13KB, 200x200px) Image search: [Google]
cringe.jpg
13KB, 200x200px
>>56596068
>libraries
>>
>>56596166
Ah, I see the problem, a bunch of functions in the example code were replaced, but the example code didn't change.
>>
>>56596161
>Not true at all.
Well, Unity, Godot, Source, CryEngine, Unreal, all support OpenGL. Is there any commonly used engine that doesn't support it?
Also after Source moved to OpenGL from direct3d it gained significant FPS boost.

>That's the absolute majority of devices out there.
Looking people around me only one girl around me uses OSX, and 50% people uses Windows, others use linux. I have two PS3 at my place and everyone who has a console I know has PS3. I don't even know anyone with xbox.

>Nope. The PS3 uses PSGL. The PS4 uses GNM, GNMX and PSSL. Nintendo uses proprietary languages/APIs that you don't even hear about unless you're a gamedev and have access to the official SDKs.
PSGL is based on OpenGL. Also it's optional, you can just use opengl on PS3 without any problems.
And of course, Android supports OpenGL which is de facto a large game market.
>>
File: girls_laughing.jpg (43KB, 600x363px) Image search: [Google]
girls_laughing.jpg
43KB, 600x363px
>>56596459
>pAnjeetdroid
>>
>>56596514
>he got fucked in the ass by Apple or Windows
>>
File: N9.jpg (130KB, 1024x768px)
N9.jpg
130KB, 1024x768px
>>56596636
>he doesn't use a free non-pajeet mobile OS
>>
>>56596781
At least my OS have apps.
I use Cyanogen anyway.
>>
File: strongautism.png (2MB, 938x897px) Image search: [Google]
strongautism.png
2MB, 938x897px
>>56596839
>muh softwares
>>
File: giphy(2).gif (443KB, 497x280px) Image search: [Google]
giphy(2).gif
443KB, 497x280px
>>56595298
>>56595443
>>56595560
>>56595631
>>56595892
>>56595960
>>56596035
>>56596166

Who dis?
>>
File: 1425169400349.jpg (104KB, 700x520px) Image search: [Google]
1425169400349.jpg
104KB, 700x520px
>>56596916
It's the local wolf girl, Momiji Inubashiri.
>>
>>56596977
Thx :3
I got a nice webm of her playing a flute but sound isn't allowd :c
>>
>>56596190
Did you link all the required libraries in the proper order? Add directories for compiler and linker into the project's settings?
Replying cuz awoooo
>>
>>56598588
Post on gif and link
>>
>>56598588
>>56598688
I know that one https://www.youtube.com/watch?v=ArJe--CGatg

ARF!
Thread posts: 34
Thread images: 15


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.