In Silverfrost/Salford library of EXAMPLES there exist an OpenGL example ANIMATE.FOR which I successfully used and then expanded knowing absolutely nothing more about OpenGL, just using this example. Wrote even 3D game using it. But where I did not succeed for 25 years is tic numbering of X an Y axis. Can anyone make numbering of each tics in this famous example ? The problem is that unlike draw_characters@('text',x,y,color) which you can call multiple times and each time the text will be plotted at the same point (x,y) or any other at your will, the glCallLists (nchars, GL_UNSIGNED_BYTE, 'text') which is analog of draw_characters@, shifts the position by the width and dimension of plottext text 'text' and you can not return it back and plot in the same place. As a result you never know exact position of plotted characters (or it is just me who does not know this). Ones per decade I return to numbering and every time fail miserably.
**********************************
* *
* Trial OPENGL program *
* *
**********************************
subroutine spinDisplay(spin)
include <opengl.ins>,nolist
include <clearwin.ins>,nolist
double precision spin
logical do_draw
common /animate_com/ do_draw
if (do_draw)then
call glClear (OR(GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT))
call glMatrixMode (GL_MODELVIEW)
call glLoadIdentity()
call glTranslated(0d0,0d0,-10d0)
call glRotated(spin,1d0,0d0,0d0)
call glCallList(101)
call swap_opengl_buffers()
spin=spin+2d0
endif
call temporary_yield@()
end
subroutine spinSlab()
logical do_draw
common /animate_com/ do_draw
data do_draw/.TRUE./
do_draw=.TRUE.
end
subroutine stopSlab()
logical do_draw
common /animate_com/ do_draw
do_draw=.FALSE.
end
subroutine assemble_list
include <clearwin.ins>,nolist
include <opengl.ins>,nolist
real*4 white_colour(4), grey_colour(4), dark_grey_colour(4)
real*4 red_colour(4), yellow_colour(4), green_colour(4)
real*4 blue_colour(4), purple_colour(4), cyan_colour(4)
real*8 dimension,scale,d,fd,front,back
integer flags,k
integer hdc
logical ok
external opengl_proc
data white_colour/1.0,1.0,1.0,1.0/
data grey_colour/0.5,0.5,0.5,1.0/
data dark_grey_colour/0.3,0.3,0.3,1.0/
data red_colour/1.0,0.0,0.0,1.0/
data yellow_colour/1.0,1.0,0.0,1.0/
data green_colour/0.0,1.0,0.0,1.0/
data blue_colour/0.0,0.0,1.0,1.0/
data purple_colour/1.0,0.0,1.0,1.0/
data cyan_colour/0.0,1.0,1.0,1.0/
data front,back/-0.01d0,-0.5d0/
call glEnable(GL_DEPTH_TEST)
hDC=clearwin_info@('OPENGL_DEVICE_CONTEXT')
call glColor3f(1.0,1.0,1.0)
ok=wglUseFontOutlines(hDC, 0, 255, 1000, 0.0, 0.1,
& WGL_FONT_POLYGONS,core4(0))
call glMatrixMode (GL_MODELVIEW)
call glLoadIdentity()
call glTranslated(0d0,0d0,-10d0)
C
C Clear the color and depth buffers.
C
call glClear (OR(GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT))
dimension=2.2d0
scale=dimension*0.9d0
call glDisable(GL_LIGHTING)
call glNewList(101,GL_COMPILE)