
Glitter – Dead-simple boilerplate for OpenGL - Polytonic
https://github.com/Polytonic/Glitter
======
shadowmint
FYI one of the lesser known features of cmake is that it can invoke your build
tool as well:

    
    
        cmake ..
        cmake --build .
    

This smartly invokes make/ninja/msbuild or whatever directly from the command
line; very useful on windows machines or to have 'universal' cmake runners for
CI that touches multiple platforms.

(Also, tutorials; `cmake .. && cmake --build .` _should_ smartly determine the
correct compiler for the system and build it; you don't need the -G "FOO"
stuff unless you're specifically doing something fancy)

~~~
Polytonic
TIL! This is awesome! I never knew about this.

What does it do under Windows? Does it run say, devenv.exe/msbuild in the
shell, as opposed to in Visual Studio?

~~~
shadowmint
Yes, that's exactly what it does, if you're using the VS backend (which is the
default).

(So you can actually be in 100% console mode in windows if you want and never
launch VS. :)

------
DanAndersen
To help improve my OpenGL/graphics knowledge, I've started going through GPU
Gems (
[https://a248.e.akamai.net/f/248/10/10/http.developer.nvidia....](https://a248.e.akamai.net/f/248/10/10/http.developer.nvidia.com/GPUGems/gpugems_part01.html)
) and building my own examples of the concepts in each chapter. I was very
happy to find Glitter recently, as it made the obnoxious hurdle of setting up
all the dependencies unnecessary.

Also, setting up Glitter was what led me to finally "getting" what CMake was
for and how it fit into a development pipeline.

~~~
Polytonic
Yeah, CMake is a bit of a complicated beast to "learn" so to speak. I spent a
fair number of hours pulling my hair out trying to get it working.

This is the result! Hope you find it helpful!

~~~
santaclaus
Is there a particular reason you choose to explicitly add CXX flags
('-std=c++11') over CMake's compiler feature support? The later is, in
principle, more portable and future proof than hardcoding the flags.

~~~
Polytonic
This was asked in an issue earlier today. It's a combination of 1) I didn't
even know such flags existed! and 2) I had some compatibility issues with
older versions of CMake on my test machines.

I'll look into adding it in the future though!

------
Polytonic
This might be easier on the eyes for people as well:
[http://polytonic.github.io/Glitter/](http://polytonic.github.io/Glitter/)

Looks a bit prettier than the default GitHub repository page anyway.

------
ronjouch
Neat, thanks for your work!

Newbie interested in OpenGL here, I followed the instructions but get a
segfault, any idea? I pasted my session at
[http://pastebin.com/hxXauQSQ](http://pastebin.com/hxXauQSQ)

~~~
Polytonic
Hi, can you open a GitHub issue for this? Would prefer to keep problems
centralized to the repository.

~~~
ronjouch
Sure, will do, I was just thinking it was some error of mine.

~~~
Polytonic
Hey, I noticed you haven't actually opened an issue. Did you work through your
problem or ...?

~~~
ronjouch
Sorry, got busy just after posting. Here's a GitHub issue:
[https://github.com/Polytonic/Glitter/issues/8](https://github.com/Polytonic/Glitter/issues/8)

------
santaclaus
Super cool! How does this compare to the (now mostly defunct) GLUT?

~~~
Polytonic
GLUT is a windowing library. GLFW3, SDL, SFML mostly replace everything it
does in terms of windowing and input.

:)

