GLUT issues.

Started by
2 comments, last by Vlion 22 years, 8 months ago
OK. I am using glut, and have it fairly well implemented. I`m runninng into 2 probs. glutKeyboardFunc() only takes the first 128 keys. It does not take the arrow keys or the Insert/home/pgup key block. Also...How do I scale text ? Anyway, heres my kinda demo... 64x64 shaded polygons. keys are q,w,a,s,z,x,d,u,l,,r,n,h,ctrl-c, space, and f. q,w,a,s,z,x,d,u,l,,r,n,h are movement keys. ctrl-c is quit. Just like back in the day. space is reset the view. f switches from windowed 800x600 to glut`s fullscreen and back. Oh yeah...in gluts full-screen...how do I get rid of the taskbar at the bottom. Right and left buttons when clicked zoom in/out :-) http://members.fortunecity.com/jktourn/w32.exe Thanks ~V''lion If anyone for a obscure reason desires the source code, just tell me... I came, I saw, I got programmers block. ~V''''lion
~V'lionBugle4d
Advertisement
Hi,

Firstly, in order to catch stuff like the arrow keys, you need to register a glutSpecialFunc(...)

Secondly, to scale text, just call glScalef(x,y,z) before rendering it, to stretch in whatever manner you desire.

As for the fullscreen thing, I can only suggest you look through the GLUT documentation here ... you''ll generally find answers about stuff like this quicker just by having a quick browse.

cheers and all that
Adam
Actually, with glutKeyboardFunc(), you can use the #defined values GLUT_KEY_UP (or something along those lines, I''m at work so can''t look at at the moment) to catch the directional keys on the keyboard. This also allows trapping of the F1 through F12 keys...so, the Insert and Home keys may be in there as well.

cheers,
Brendan.
I dug up the glutSpecialFunc() stuff and have implemented it.

Now I`ve realized that to do what I want with my engine I need animated textures somewhere down the line.
Any ideas on how to go about that ?
I`m thinking that switching textures each frame is notably inefficient. Woould multi-textureing be a help ?
Any tutorials out there that deal in animating textures ?
And to blend one texture on a polygon with another- thats multi-texturing right ?
-vlion

I came, I saw, I got programmers block.
~V''''lion
~V'lionBugle4d

This topic is closed to new replies.

Advertisement