Re: RE : Re: GLUT

From: Warrender, Christina E <cewarr_at_sandia.gov>
Date: Mon, 7 Feb 2005 09:47:34 -0700

Thanks for the tips. Unfortunately, I'm having even less success than
Roger did originally; I get an access violation on the glutInit right at
the beginning. If I try to do glutInit interactively, the problem seems
to happen somewhere in ?IMPORTED. =20

Christy
=20

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf
Of Charles Melice
Sent: Monday, February 07, 2005 1:11 AM
To: sftalk_at_forth.com
Subject: [sftalk] RE : Re: GLUT

Another problem can arise with the float stack inside a callback
definition:

:NONAME ( -- res )
    [DEFINED] NUMERICS [IF] #NS FSTACK [THEN] \ always use this =3D
preambule !
    ... your code here ...
; 4 CB: TheCallback

Charles

-----Message d'origine-----
De : sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] De la part
=3D de Warrender, Christina E
Envoy=3DE9 : jeudi 3 f=3DE9vrier 2005 18:16
=3DC0 : sftalk_at_forth.com
Objet : [sftalk] Re: GLUT

I have the same question that Roger asked below in 2003 about using GLUT
=3D and OpenGL with SwiftForth. I didn't see an answer in the archive -
can =3D anyone fill me in? Christy

Has anybody tried using GLUT & OpenGL with SF? I've had success =3D
displaying polygons with Charles Melice's window/viewport setting-up
code (which I really really appreciate, btw), but I'd really like to use
GLUT so I can take advantage of the numerous tutorials online that rely
on it, and to enable me to get good mouse/keyboard responsiveness. The
callbacks are giving me trouble, though. I think I've set everything up
correctly:=3D20 :NONAME=3D20 GL_COLOR_BUFFER_BIT glClear=3D20
1 1 1 glColor3ub=3D20
GL_POLYGON glBegin=3D20
200 125 glVertex2i=3D20
100 375 glVertex2i=3D20
300 375 glVertex2i=3D20
glEnd=3D20
glFlush=3D20
; 0 CB: DisplayCB=3D20
:NONAME ( key x y -- )=3D20
2drop [char] q =3D3D=3D20
if=3D20
quit=3D20
then=3D20
; 3 CB: checkkeyCB=3D20
\ dummy arguments for GLUT, the rascal=3D20 variable argc \ number of
arguments=3D20 variable argv \ number of arguments=3D20 create args ," =
-a" 0
c,=3D20 0 value win=3D20
: main ( -- )=3D20
1 argc ! \ init dummy argument vars=3D20
args argv !=3D20
argc args glutInit=3D20
GLUT_RGB glutInitDisplayMode=3D20
600 350 glutInitWindowSize=3D20
z" Triangle" glutCreateWindow to win=3D20
0 0 0 0 0 0 0 0 glClearColor=3D20
0 400 0 500 gluOrtho2D=3D20
DisplayCB glutDisplayFunc \ Callback=3D20
\ checkkeyCB glutKeyboardFunc=3D20
glutMainLoop ;=3D20
It gets as far as glutMainLoop and then crashes with an ACCESS =3D
VIOLATION. :
(=3D20
The interesting part though, is sometimes it actually displays a window,
without graphics and still with the access violation - only when i DEBUG
=3D it, though.=3D20 Roger=3D20

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com =
=3D
For list command help, send subject "help" to sftalk-request_at_forth.com =
=3D
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug=3D20 reports, please send email to support_at_forth.com
----------------------------------------------------------------------

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Mon Feb 07 2005 - 08:49:43 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.