PDA

View Full Version : can I use glut with out initializing it?



bansheeogl
05-01-2005, 06:19 PM
I want to use some glut features but I already make my own window, I dont want to use glut's, is this possible? how can I do it? I tryed calling a glut teapot for example and it doesnt show up because glut crashes/ I get an error

dorbie
05-02-2005, 11:07 AM
I don't think you can do this. You could grab the teapot code out of glut or find it online.

rcpedersen
05-04-2005, 12:36 AM
I think I have some teapot code some where message me your email and I can provide it for you.

Danny Holten
05-04-2005, 02:45 AM
Hello there,

It should very well be possible to use functions from the glut library within your program without using glut for window management, i.e., without initializing glut.

I personally program my OpenGL applications on Windows XP using Borland Delphi combined with the Delphi OpenGL Toolkit. This toolkit does not use glut for window management (the basic applications do not require glut.dll to run), but when I add the glut unit to my projects (in order to call glut drawing functions), make sure that glut.dll is available to my program, and subsequently call glutSolidTeapot(1.0) from my code, it all works fine.

Are you sure that the glut.dll library (http://www.xmission.com/~nate/glut.html in case you're programming on Windows) is available to your program? The crash might be related to that.

Regards,

Danny Holten.

powerpad
05-04-2005, 03:42 AM
to get the teapot just browse the start site's topics (opengl.org) and look for some headline that says sh script for teapot or something otherwise the following code is the shell script that creates the teapot ...

</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">#!/bin/sh
# This is a shell archive (shar 3.21)
# made 01/27/1992 19:47 UTC by hollasch@bigmoma
# Source directory /auto/matrix3/user/hollasch/gfx/notes
#
# existing files WILL be overwritten
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 491 -rw-r--r-- teapot/TPOTBC.TEXT
# 1203 -rw-r--r-- teapot/TPOTHH.TEXT
# 358 -rw-r--r-- teapot/TPOTLC.TEXT
# 1151 -rw-r--r-- teapot/TPOTLQ.TEXT
# 1205 -rw-r--r-- teapot/TPOTSH.TEXT
# 2430 -rw-r--r-- teapot/teapot.poster
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
then TOUCH=touch
else TOUCH=true
fi
# ============= teapot/TPOTBC.TEXT ==============
if test ! -d 'teapot'; then
echo "x - creating directory teapot"
mkdir 'teapot'
fi
echo "x - extracting teapot/TPOTBC.TEXT (Text)"
sed 's/^X//' << 'SHAR_EOF' > teapot/TPOTBC.TEXT &&
X OUTLINE CURVE OF BODY OF TEAPOT
X SWEEP AROUND Y AXIS FOR WHOLE BODY
X
XPNT 1, 1.40000, 2.25000, 0.00000,,,,
XPNT 2, 1.33750, 2.38125, 0.00000,
XPNT 3, 1.43750, 2.38125, 0.00000,
XPNT 4, 1.50000, 2.25000, 0.00000,
X
XBEZC 1,2,3,4
X
XPNT 5, 1.75000, 1.72500, 0.00000,
XPNT 6, 2.00000, 1.20000, 0.00000,
XPNT 7, 2.00000, 0.75000, 0.00000,
X
XBEZC 4,5,6,7
X
XPNT 8, 2.00000, 0.30000, 0.00000,
XPNT 9, 1.50000, 0.07500, 0.00000,
XPNT 10, 1.50000, 0.00000, 0.00000,
X
XBEZC 7,8,9,10
SHAR_EOF
$TOUCH -am 0127120892 teapot/TPOTBC.TEXT &&
chmod 0644 teapot/TPOTBC.TEXT

agemenon
05-05-2005, 04:14 PM
of course you can use features of glut without using its window managment.
just #include <GL/glut.h>
and
link glut32.lib
I think you get the error because you don't link glut32.lib