| | |
OpenGL problem
Thread Solved |
•
•
Join Date: Nov 2007
Posts: 6
Reputation:
Solved Threads: 0
I've been having some trouble using OpenGl in Delphi. Can anyone tell me what I might have done wrong.
Click here for a screen shot.
Click here for a screen shot.
•
•
Join Date: Nov 2007
Posts: 6
Reputation:
Solved Threads: 0
delphi Syntax (Toggle Plain Text)
procedure TForm1.Draw; const ambientLight : TGLArrayf4 = (0.3, 0.3, 0.3, 1.0); lightColor : TGLArrayf4 = (0.7, 0.7, 0.7, 1.0); lightPos : TGLArrayf4 = (-2 * 6, 6, 4 * 6, 1.0); var c : CCube; begin glViewport(0, 0, Width, Height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0, width / height, 1.0, 200.0); c := CCube.Create; c.posx := 0; c.posy := 0; c.posz := 0; c.sizex := 6; c.sizey := 2; c.sizez := 6; glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0.0, 0.0, -20.0); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, @ambientLight); glLightfv(GL_LIGHT0, GL_DIFFUSE, @lightColor); glLightfv(GL_LIGHT0, GL_POSITION, @lightPos); glRotatef(-45, 1.0, 1.0, 0.0); //glShadeModel(GL_FLAT); c.Draw; SwapBuffers(wglGetCurrentDC); end;
this code is ran on draw. c.draw; calls a function in my CCube class which does the actual drawing which i don't think the problem is in.
delphi Syntax (Toggle Plain Text)
glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_NORMALIZE); glEnable(GL_COLOR_MATERIAL);
above is the code that is called after opengl is initialized.
Last edited by eenceo; Feb 24th, 2009 at 4:53 pm.
![]() |
Similar Threads
- Really Weird OpenGL Problem (C++)
- OpenGL's coordinates (C++)
- openGL problem (C++)
- Windows XP keeps restarting since a new video card (Windows NT / 2000 / XP)
- I need a solution for a opengl thing (C++)
- Randomize number with OpenGL (C++)
- Installed Windows 2000 P, have Video Card problem (Windows NT / 2000 / XP)
- Windows vs Linux (IT Professionals' Lounge)
Other Threads in the Game Development Forum
- Previous Thread: DirectX - Collision detection
- Next Thread: Directx Input / Movement Q
| Thread Tools | Search this Thread |
3d advertising ai algorithm ban c++ cambridge camera censorship china competition console development engine fov fpx game gamer games gaming gauntanamo government idaho in-gameadvertisement intellectualproperty l-systems laracroft lindenmayer live manhunt math mathematics matrix mercenaries microsoft mmorpg modded msn naked news nintendo obama opengl palin physics pirate playstation politics projection ps3 rpg search selection software sony stephenhawking stocks studio technology terrorism tombraider uk videogame web wii world-of-warcraft xbox xbox-live xbox360






