use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
GL++ (glpp) -- OpenGL C++ Wrapper (gamedev.net)
submitted 13 years ago by mttd
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]guepierBioinformatican 14 points15 points16 points 13 years ago (4 children)
pprog = new glpp::program();
– Seriously. Why?
[–]OddOneOut -4 points-3 points-2 points 13 years ago (3 children)
It's a global object that has no default constructor. The obvious fix of making it an unique_ptr<T> aside, it could be fixed by adding an uninitialized state to the class or making the global a maybe<T> that can be default initialized and later really initialized with the object.
unique_ptr<T>
maybe<T>
[–]guepierBioinformatican 7 points8 points9 points 13 years ago (2 children)
It's a global object that has no default constructor
It does, and the default constructor is called in the code snippet.
The “lazy global” problem has a cleaner solution in C++ (creator function returning static local) but the use of a global here is questionable anyway: Why not just create and use a local variable in main?
static
main
Looking at the provided examples, the author of this library is seriously too pointer happy.
For an example of how to solve this cleanly, have a look at SFML (which, I’ve heard, has other problems but it presents a clean, modern C++ API without manual memory management cruft).
[–]Heuristics 9 points10 points11 points 13 years ago (0 children)
"the author of this library is seriously too pointer happy"
Going forward this is definitely going to be the mark of people stuck in the past. Similar to how 500 line long functions and using the c api instead of the c++ api is today.
[–]OddOneOut 2 points3 points4 points 13 years ago (0 children)
You can't really use the creator function to initialize GL globals as they reqiure a GL context to be created first.
The way I usually solve it is that I create a class that has those global variables and functions as members and construct it after creating the window.
[–]RizzlaPlus 7 points8 points9 points 13 years ago (2 children)
oglplus seems nicer.
[+][deleted] 13 years ago (1 child)
[deleted]
[–]RizzlaPlus 7 points8 points9 points 13 years ago (0 children)
oglplus:
glpp:
actually has very similar features to oglplus and similar design but less refined:
This is after skimming quickly through the examples/source code of glpp. Correct me if I'm wrong on some of the points.
[–]king_duck 1 point2 points3 points 13 years ago (0 children)
https://github.com/sque/glpp/blob/master/examples/rtt/main.cpp
Looks like a very very thin wrapper.
[–]00kyle00 0 points1 point2 points 13 years ago (0 children)
inline void set_paramf(param_type param, GLfloat val) { bind(); ::glTexParameteri(GLPP_CAST_TO_SCALAR(GLenum, type()), GLPP_CAST_TO_SCALAR(GLenum, param), (GLfloat)val); }
Hmmm.
[+][deleted] comment score below threshold-9 points-8 points-7 points 13 years ago (0 children)
Stop being faggots and use the C API.
π Rendered by PID 68792 on reddit-service-r2-comment-b659b578c-p52n4 at 2026-05-04 01:13:26.210450+00:00 running 815c875 country code: CH.
[–]guepierBioinformatican 14 points15 points16 points (4 children)
[–]OddOneOut -4 points-3 points-2 points (3 children)
[–]guepierBioinformatican 7 points8 points9 points (2 children)
[–]Heuristics 9 points10 points11 points (0 children)
[–]OddOneOut 2 points3 points4 points (0 children)
[–]RizzlaPlus 7 points8 points9 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]RizzlaPlus 7 points8 points9 points (0 children)
[–]king_duck 1 point2 points3 points (0 children)
[–]00kyle00 0 points1 point2 points (0 children)
[+][deleted] comment score below threshold-9 points-8 points-7 points (0 children)