[프로그래밍] Open GL
- 최초 등록일
- 2002.09.19
- 최종 저작일
- 2002.09
- 5페이지/ 압축파일
- 가격 1,000원
소개글
Open GL을 이용하여 간단한 구(sphere)를 화면에 뿌려주는 소스입니다.
조명도 하나 들어갔구요..
목차
없음
본문내용
#include <windows.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <gl\glaux.h>
HDC hDC=NULL;
HGLRC hRC=NULL;
HWND hWnd=NULL;
HINSTANCE hInstance;
GLUquadricObj *obj; // 그릴 도형을 생성하기 위한 포인터
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // 윈도우 프로시저 선언
GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize시 함수선언
{
if (height==0) // 높이값이 0이 되면 나눌 수 없으므로,
{
height=1; // 높이를 1로 잡아줌
}
glViewport(200,-150,width,height); // Viewport 값의 설정
glMatrixMode(GL_PROJECTION); // 매트릭스 모드 설정
glLoadIdentity(); // 매트릭스 초기화
// 윈도우에 그려질 perspective 값 설정
참고 자료
없음
압축파일 내 파일목록
smooth/smooth.ncb
smooth/smooth.opt
smooth/smooth.dsw
smooth/smooth.plg
smooth/smooth.dsp
smooth/smooth.cpp
smooth/Debug/vc60.idb
smooth/Debug/vc60.pdb
smooth/Debug/smooth.pch
smooth/Debug/smooth.obj
smooth/Debug/smooth.ilk
smooth/Debug/smooth.exe
smooth/Debug/smooth.pdb
flat/flat.cpp
flat/flat.dsw
flat/flat.dsp
flat/flat.ncb
flat/flat.plg
flat/flat.opt
flat/Debug/vc60.idb
flat/Debug/vc60.pdb
flat/Debug/flat.pch
flat/Debug/flat.obj
flat/Debug/flat.ilk
flat/Debug/flat.exe
flat/Debug/flat.pdb