Download presentation
1
Introduction to OpenGL
By NematAllah Ahmadyan
2
About OpenGL Open Graphic Library is an open-source library for displaying 2D/3D shapes. a software interface to graphics hardware.
3
implementation Mesa3D Linux mostly GLUT Linux, ported to Win32
4
Using GLUT under Win32 Obtain GLUT from web
Some IDEs ( like Dev-Cpp ) comes with bundled OpenGL/Glut #include <gl/gl.h> #include <gl/glut.h> // handles windows
5
Create a Window And add event handler Enable OpenGL Disable OpenGL Exit Calculate the moment And motion, Finished? Yes No Calculate the screen points Clear the device Draw the shape(s)
6
Prototype void DisableOpenGL (HWND hWnd, HDC hDC, HGLRC hRC);
LRESULT CALLBACK WndProc (HWND hWnd, UINT message,WPARAM wParam, LPARAM lParam); void EnableOpenGL (HWND hWnd, HDC *hDC, HGLRC *hRC); void DisableOpenGL (HWND hWnd, HDC hDC, HGLRC hRC); void Simulate(); int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.