Do you set the font somewhere? e.g.
gl_font(1, 12);
Perhaps try this test code:
http://seriss.com/people/erco/fltk/#OpenGlTextOn3D
While it's not opengl3, it uses the same function.
Under MacOS, OpenGL can be used either according to the fixed function pipeline (that is, OpenGL versions 1 and 2)or with shaders and program pipelines (a.k.a., core profile), but mixing both modes is impossible. That's why gl_draw()and gl_rect() don't work in MacOS when using OpenGL 3: both use glBegin()/glEnd() which are not supported by the core profile.The present FLTK text drawing functions are therefore ineffective under MacOS when used in core profile mode.It's however entirely possible to use OpenGL in compatibilty profile and to draw text. FLTK's OpenGL text supportunder MacOS+compatibility mode is in fact better than it's on Windows and X11 because all of Unicode and all fontscan be used.Here is an explanation taken from the OpenGL documentation atPlatform Issue (MacOSX): When MacOSX 10.7 introduced support for OpenGL beyond 2.1, they also introduced the core/compatibility dichotomy. However, they did not introduce support for the compatibility profile itself. Instead, MacOSX gives you a choice: core profile for versions 3.2 or higher, or just version 2.1. There is no way to get access to features after 2.1 and still access the Fixed Function Pipeline.
You may refer to this document describing how to draw text in OpenGL3:In FLTK 1.3.4, source file src/gl_draw.cxx contains the MacOS implementation of text drawing in the form of textureswritten to the GL scene according to the fixed pipeline model. Function compute_texture() computes a texturefor a string and memorizes it in a FIFO list of textures. Function display_texture(int rank) draws the texture at indexrank in the FIFO of textures. Function gl_draw_textures(string, l) pilots the use of textures determining if the stringis new (a new texture is to be computed) and which texture needs to be drawn.It's may be possible to reuse compute_texture() where most MacOS-specifics are located, and devise what wouldcorrespond to display_texture() in the OpenGL3 logic?
Yes, as a developer it's preferable to work relatively to FLTK 1.4.Function gl_draw_textures() of 1.3 is named Fl_Cocoa_Gl_Window_Driver::draw_string() in 1.4.Differences between 1.3 and 1.4 consist in a clear separation of the platform-specific andplatform-independent parts. But the implementation itself is unchanged.
The public API toFl_Window::size_range (int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0)is unchanged between 1.3 and 1.4. In both cases default argument values allow to callit with only 2 arguments, or with more.Do you mean something else?
Undefined symbols for architecture x86_64:
"Fl_Window::size_range(int, int, int, int, int, int, int)", referenced from:
sim::Display::Display(sim::Simulator&, int, int, char*) in display.cpp.o
ld: symbol(s) not found for architecture x86_64
When I tried to use FLTK 1.4 with my application which subclasses Fl_Gl_Window I getUndefined symbols for architecture x86_64:
"Fl_Window::size_range(int, int, int, int, int, int, int)", referenced from:
sim::Display::Display(sim::Simulator&, int, int, char*) in display.cpp.o
ld: symbol(s) not found for architecture x86_64
I call size_range(400, 400) in one placeThis error does not appear when I use FLTK 1.3
It's most probaby what Albrecht suggests. I have added here a call to Fl_Window::size_range()to file examples/OpenGL3test.cxx and there's no link error under MacOS.