pouët.net

modern OpenGL on Windows

category: code [glöplog]
 
Hello guys!

I was wondering, is there a decent, minimal and modern OpenGL setup code and stuff for Windows somewhere that I could rip? Yeah, I know I really should use DirectX but I'm just way more familiar with OGL and with the very limited amount of time and energy for coding, I'd not learn something mostly from scrach, plus I'd be interested in working on OS X as well. My stuff is from 2005 or something, and really not up to par at all and I suck at writing any kind of setup code.
added on the 2016-03-30 13:52:09 by Preacher Preacher
Well, there's Cider, SFML, OpenFrameworks etc. but that's obviously more than just "minimal setup code". Or just bite the bullet and use three.js. That one is quick to setup, anyway. ;)
added on the 2016-03-30 14:49:12 by tomaes tomaes
Haven't looked at it in any depth, but there is glFast. Also check this amazing collection of samples that are all self-contained without relying on any frameworks.
added on the 2016-03-30 15:36:36 by cupe cupe
For OS X it is important to know that El Capitan is still stuck at opengl 4.1 from 2010. Ugh.
Elegantly ignoring your demands for minimality: SDL2 for setting up a window and a (possibly core) context, epoxy for getting function pointers with no pain (much less than GLEW, at any rate).
added on the 2016-03-30 15:54:44 by Sesse Sesse
the winapi window + context creation stuff is ~200 lines, a glarb.h parser abouts the same, should take you about 3 nights of code-ing
added on the 2016-03-30 16:03:59 by msqrt msqrt
Thanks for the tips, guys. I'll check these out asap.

Quote:
should take you about 3 nights of code-ing

... which is exactly what I am trying to avoid :)
added on the 2016-03-30 16:09:11 by Preacher Preacher
I haven't been working on it since quite a while, but you might still want to give https://github.com/sschuberth/gale/ a try.
added on the 2016-03-30 17:05:37 by eyebex eyebex
iq's main framework, or other frameworks on his code page. E.g., the 1k/4k OGLShader ones might get you started quickly.
added on the 2016-03-30 17:33:24 by cxw cxw
In VS2015 you can just click all the OpenGL libs as a NuGet package for your project .. as described here: http://in2gpu.com/2014/11/29/setting-opengl-visual-studio-using-nuget/
bgfx anyone? It's a rather high level rendering engine, but a pretty cool codebase with plenty of examples.
added on the 2016-03-30 19:16:57 by Zavie Zavie
I've never understood what's the problem with GLEW. I use SDL2 + GLEW on all platforms, and it works like a charm.

Note: I compile GLEW myself on Windows.
added on the 2016-03-31 09:55:57 by Trilkk Trilkk
also use GLEW, and also just include GLEW.c in my projects rather than statically linking.

this http://oglplus.org/ looks interesting. i've referred to the code a few times when trying to get something to work.. but have mostly rolled my own.
added on the 2016-03-31 11:54:21 by Canopy Canopy
Canopy: Really, use epoxy instead of GLEW. Especially if your goal is modern OpenGL.
added on the 2016-03-31 15:41:42 by Sesse Sesse
Trikk: GLEW doesn't support core contexts, and it doesn't understand function aliases. There's simply no good reason to use it when epoxy is available; it was good for its time, but now it's pretty irrelevant.
added on the 2016-03-31 15:43:25 by Sesse Sesse
Sesse, your points make sense. The thing is, on *nix or when developing for GLES, I've been just using the libraries as-is (since it's possible), so I haven't really ran into issues with GLEW. Especially crawling the GL shared objects and importing by hash, you end up with correct function pointers anyway.

Will take a look at epoxy, looks excellent. Here's a link for others: https://github.com/anholt/libepoxy
added on the 2016-03-31 16:38:39 by Trilkk Trilkk
Quote:
Canopy: Really, use epoxy instead of GLEW. Especially if your goal is modern OpenGL.


Thanks it is, and it also includes the mobile side of things.

Iy wouldn't be hard to swap to libexpoxy, and IIRC i did hit an in issue with a function pointer not being set when I expected. (I have one project to get off my plate before I can get back doing GL stuff in anger) I think to do with wglSwapInterval..

I've not hit a stage where I'm overly fussy but I am going plan cross-platform so this does look like a better route for me. Thanks for bringing it to my attention. :)
added on the 2016-03-31 17:55:44 by Canopy Canopy
Quote:
Trikk: GLEW doesn't support core contexts, and it doesn't understand function aliases. There's simply no good reason to use it when epoxy is available; it was good for its time, but now it's pretty irrelevant.

There's one reason: It doesn't require a Unix environment to build. Quite ironic to use Autotools for something modern and cross-platform. :)
added on the 2016-04-01 00:58:34 by absence absence
Well, now you can get Ubuntu on Windows 10, no complaining :-D
added on the 2016-04-01 01:57:16 by Sesse Sesse
Stacking operating systems is the only natural way upward for the computational tower of Babel after all the layers of web technology in recent years. Can't wait to see what's next!
added on the 2016-04-01 14:30:05 by absence absence
2017: 90% of recent demos break because a vec3-translate npm package is unpublished following some minor unrelated scene-drama.
added on the 2016-04-03 07:08:24 by bloodnok bloodnok
For the record, I ended up going with GLFW instead of rolling my own. Multiplatform is a plus :)
added on the 2016-04-05 10:06:35 by Preacher Preacher

login