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.
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.
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. ;)
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).
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
Thanks for the tips, guys. I'll check these out asap.
... which is exactly what I am trying to avoid :)
Quote:
should take you about 3 nights of code-ing
... which is exactly what I am trying to avoid :)
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.
iq's main framework, or other frameworks on his code page. E.g., the 1k/4k OGLShader ones might get you started quickly.
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.
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.
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.
Canopy: Really, use epoxy instead of GLEW. Especially if your goal is modern OpenGL.
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.
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
Will take a look at epoxy, looks excellent. Here's a link for others: https://github.com/anholt/libepoxy
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. :)
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. :)
Well, now you can get Ubuntu on Windows 10, no complaining :-D
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!
2017: 90% of recent demos break because a vec3-translate npm package is unpublished following some minor unrelated scene-drama.
For the record, I ended up going with GLFW instead of rolling my own. Multiplatform is a plus :)