Fl_Gl_Window and the new OpenGL 3+

102 views
Skip to first unread message

Duncan Gibson

unread,
Oct 27, 2017, 8:21:25 AM10/27/17
to fltkg...@googlegroups.com
I have an application that could benefit from some diagrams that show
the control points for basic planar shapes and also 2D projections of
simple 3D wireframe shapes (e.g. boxes, spheres, cylinders, cones, and
paraboloids).

I'm no OpenGL expert (I've not even looked at it for 10 years or so)
and didn't want the additional dependencies if I could avoid it, so
I wrote a prototype which did the projection onto a viewing plane and
then drew it into an Fl_Box using the standard FLTK drawing functions.
The results for the curved 3D shapes were pretty poor, probably due to
poor assumptions in my own projection code, so I thought I'd try using
OpenGL.

I was surprised to find that OpenGL has evolved, that the code I was
using 10 years ago has been deprecated in OpenGL 3+, and that even
Greg's 3D cheat sheet example has had to be revamped. Greg's example
ran, but my first attempt "the old way" didn't draw what I expected.

So before I spend time fighting with the new system, some questions:

1. Does Fl_Gl_Window just provide the graphics context and then it
doesn't matter whether I use glBegin() etc, the new Shader stuff?

2. If it does matter, will Fl_Gl_Window be updated for OpenGL 3+ ?
Will it support both old and new styles?

3. Should I just stick to the old glBegin() and what I already know?

Cheers
D.

This message and any attachments are intended for the use of the addressee or addressees only.
The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its
content is not permitted.
If you received this message in error, please notify the sender and delete it from your system.
Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.


Manolo

unread,
Oct 27, 2017, 8:55:56 AM10/27/17
to fltk.general


On Friday, 27 October 2017 14:21:25 UTC+2, duncan wrote:
I have an application that could benefit from some diagrams that show
the control points for basic planar shapes and also 2D projections of
simple 3D wireframe shapes (e.g. boxes, spheres, cylinders, cones, and
paraboloids).

I'm no OpenGL expert (I've not even looked at it for 10 years or so)
and didn't want the additional dependencies if I could avoid it, so
I wrote a prototype which did the projection onto a viewing plane and
then drew it into an Fl_Box using the standard FLTK drawing functions.
The results for the curved 3D shapes were pretty poor, probably due to
poor assumptions in my own projection code, so I thought I'd try using
OpenGL.

I was surprised to find that OpenGL has evolved, that the code I was
using 10 years ago has been deprecated in OpenGL 3+, and that even
Greg's 3D cheat sheet example has had to be revamped. Greg's example
ran, but my first attempt "the old way" didn't draw what I expected.

So before I spend time fighting with the new system, some questions:

1. Does Fl_Gl_Window just provide the graphics context and then it
   doesn't matter whether I use glBegin() etc, the new Shader stuff?

2. If it does matter, will Fl_Gl_Window be updated for OpenGL 3+ ?
   Will it support both old and new styles?

3. Should I just stick to the old glBegin() and what I already know?

Cheers
D.

With FLTK you can still use old OpenGL without problem. That's for example what
is done in all GL demo programs in the test directory.

FLTK has been recently modified to allow also using OpenGL3+.
Please, see
for explanations of how to do that.
Also, try building and running
   examples/OpenGL3test.cxx
before working full size.

My understanding is that programming under OpenGL3+ is radically different
from what it is with OpenGL1 or 2. But the difference originates in OpenGL, not in FLTK.

Reply all
Reply to author
Forward
0 new messages