![]() |
![]() |
|||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||
Q: Use OpenGL in C++BuilderAnswerJohn Thomas from Borland has written an article on how to use OpenGL in a C++Builder program. His article shows how to setup a project for rendering OpenGL scenes on a VCL form. Using his article, I have a created a sample OpenGL program with C++Builder 5. You can download my program from the link at the bottom of the page. My code is almost identical to the code in the OpenGL community article, but there are some minor differences. First, I have converted the OnCreate and OnDestroy events to C++ constructors and destructors because OnCreate and OnDestroy are the work of the devil (or Object Pascal programmers, I forget which). Second, I have added some OpenGL calls to the RenderGLScene function. My code creates a three colored cube that rotates in space. And third, I have altered the project so it renders the OpenGL image in a panel control instead of drawing it directly on the form. If you are intersted in OpenGL, I suggest that you read the OpenGL article on the community website. You may also want to buy a book on OpenGL. Here are two of the more popular OpenGL books.
In addition to these books, you might want to check out Scott Heiman's website. He has some helpful information on how to use OpenGL in C++Builder. Specifically, he describes how to obtain and build the GLUT add-on library. He also provides links to other OpenGL websites. For a list of non-Borland specific OpenGL websites, visit the OpenGL section of the google directory.
| ||||||||||
All rights reserved. |