OGLIB.LIB : Boland C++5.0用ライブラリ VOGLIB.LIB : VisualStudio.NET(VC7.0)用ライブラリ OGLIB.H : グラフィックスライブラリ用ヘッダファイル OGLIB.RES : グラフィックスライブラリ用リソースファイル(ウィンドウのアイコンを定義しているだけなので無くてもかまいません)
#include <oglib.h> /***この行を追加***/ void spiral(void); void rollright(void); void main() { int i1; tg_openwin(600, 400); tg_init(); tg_draw(); tg_pu(); tg_home(); tg_save(); tg_ml(300.0); spiral(); tg_restore(); tg_save(); tg_ml(100.0); spiral(); tg_restore(); tg_save(); tg_mr(100.0); spiral(); tg_restore(); tg_save(); tg_mr(300.0); spiral(); tg_restore(); tg_view(); tg_manual(); tg_pu(); tg_home(); tg_dn(90.0); tg_bk(800.0); rollright(); tg_rr(30.0); rollright(); tg_rl(30.0); for(i1 = 0; i1 < 2; i1++){ tg_rr(30.0); tg_refresh(); tg_rl(30.0); tg_refresh(); tg_rl(30.0); tg_refresh(); tg_rr(30.0); tg_refresh(); } for(i1 = 0; i1 < 25; i1++){ tg_md(40.0); tg_refresh(); } /*** exit(0); 終了時にウィンドウをクローズする場合はこの行を有効にする***/ } void spiral() { int c, i1; tg_pu(); tg_fd(360.0); tg_dn(90.0); c = 1; for(i1 = 0; i1 < 120; i1++){ tg_setpc(c); tg_save(); tg_pd(); tg_fd(100.0); tg_pu(); tg_restore(); tg_lt(3.0); tg_md(6.0); if(c == 7) c = 1; else c++; } } void rollright() { int i1; tg_view(); tg_manual(); for(i1 = 0; i1 < 36; i1++){ tg_rt(10.0); tg_ml(800 * 3.14159 * 2 / 36); tg_refresh(); } }
bcc32 -WE -d -W test.c oglib.lib
bcc32 -WE -d -W -c test.c tlink32 /Tpe /aa /n /V4.0 /c c0w32.obj ..\oglib.lib test.obj,test.exe,,cw32.lib import32.lib,,..\oglib.res
cl /c test.c link /out:test.exe /subsystem:windows test.obj ..\voglib.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ..\oglib.res