[點評:這是用winsdk+opengl寫的,我覺得相對於這種方法而言,用fltk或是sdl的方式來呼叫opengl的方法更加簡單.]
//執行效果:乙個七彩的三角形不斷旋轉.
//程式採用win32 sdk方式書寫
/**************************
* includes
***************************/
#i nclude
#i nclude
/**************************
* function declarations
***************************/
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);
/**************************
* winmain
***************************/
int winapi winmain (hinstance hinstance,
hinstance hprevinstance,
lpstr lpcmdline,
int icmdshow)
else
}else
}/* shutdown opengl */
disableopengl (hwnd, hdc, hrc);
/* destroy the window explicitly */
destroywindow (hwnd);
return msg.wparam;
}/********************
* window procedure
*********************/
lresult callback wndproc (hwnd hwnd, uint message,
wparam wparam, lparam lparam)
return 0;
default:
return defwindowproc (hwnd, message, wparam, lparam);}}
/*******************
* enable opengl
********************/
void enableopengl (hwnd hwnd, hdc *hdc, hglrc *hrc)
用DEVC 寫的程式,表長為0是怎麼回事
已知順序表l遞增有序,寫演算法,將x插入到線性表的適當位置上,保證線性表有序。includetypedefintelemtype definemaxsize100 defineok1 defineerror0 定義線性表typedefstructseqlist 建立空表voidinitlist se...
用UBuntu開發OpenGL程式1
繼續選中libglu.so和libglut.so檔案。然後編譯鏈結通過,usr bin make f nbproject makefile debug.mk subprojects build conf make 1 正在進入目錄 home chenshu svnclient mycodes ope...
用UBuntu開發OpenGL程式1
繼續選中libglu.so和libglut.so檔案。然後編譯鏈結通過,usr bin make f nbproject makefile debug.mk subprojects build conf make 1 正在進入目錄 home chenshu svnclient mycodes ope...