You are viewing a single comment's thread from:

RE: How To Create A Home Object In 2-Dimensional Form Using C++ Programming

in #utopian-io7 years ago (edited)

Hi @elfida, having some experience with C++/OpenGL myself, I have some suggestions to improve this tutorial.

  • Using glBegin()/glEnd() to draw primitives isn't considered good style anymore in modern OpenGL. Try an implementation based on Arrays instead (look up glDrawArrays)
  • I expect that a new user will have difficulties to compile and link your example code. I'd suggest to provide a CMakeLists.txt with your source code.
  • You include stdio.h, but you don't seem to use it anywhere in your code. I also advise to use <iostream> in C++ code.
  • Indent code snippets with 4 space to achieve nicer rendering of code sections

Keep up with posting tutorials!

Sort:  

Excuse me, I still dont understand with second point, about CMakeLists.txt,
Tell me please @nafestw

My point is, that you should provide instructions on how to build your sample code. You can either provide a Visual Studio Solution or a Makefile. CMake is a meta build system for C and C++. So if you provide rules to build your project in a CMakeLists.txt, the reader can generate a project for its favorite IDE or a Makefile from it. I recommend Daniel Pfeiffer's talk on "Effective CMake" on YouTube

Thanks a lot sir