Confusion from the "Red Book"

BlitzMax Forums/OpenGL Module/Confusion from the "Red Book"

Ryan Burnside(Posted 2007) [#1]
Stippled Lines
To make stippled (dotted or dashed) lines, you use the command glLineStipple() to define the stipple pattern, and then you enable line stippling with glEnable().

First, the Red Book tells me that I need to use odd values for the stippled line values. I cannot enter the line that follows without the interperater throwing an error because it cannot understand "0x3f07". I have tried casting it but this does not produce the desired line.
glLineStipple(1, 0x3F07);
glEnable(GL_LINE_STIPPLE);


Next the book tells me that there is a wonderfull library "glut" but I can't seem to include this library with my blitzcode because blitzmax won't let the file be included.


H&K(Posted 2007) [#2]
3f07 = 16135

7+ 0*16 + 15*16*16 + 3*16*16*16


Oddball(Posted 2007) [#3]
It's a hexadecimal literal. See Help/Language/Literals in the BlitzMax help.
glLineStipple(1, $3F07);
glEnable(GL_LINE_STIPPLE);
I beleive you can use glu and glew but not sure about glut. It wouldn't be hard to import it yourself though.


Ryan Burnside(Posted 2007) [#4]
Ok thanks all for helping!

What do you mean by "import yourself"?


Oddball(Posted 2007) [#5]
Well I only took a quick look at glut, but it seems to be pretty straight forward. As glut is written in C and BltizMax understands C you can get the source and import it yourself. Check out Help/Language/Advanced topics in the BlitzMax help for more info on importing C source. The glut source can be found here.