DEV C++ και GLUT οδηγός εγκατάστασης
-
Upload
georgepapaloukas -
Category
Documents
-
view
236 -
download
1
Transcript of DEV C++ και GLUT οδηγός εγκατάστασης
-
7/23/2019 DEV C++ GLUT
1/8
Dev C++ GLUT
Oe!GL "##$% &'() C
* D,-!.,/0 1 D23 C++ "#% %"14 5#6
$#% 789ee-/9e: 6 # C++ C,;"#? "##
#@% &'() C ABB =,E9Fe8,9e !eB 9,HeFB= ,9-e..0evF 7 1#I
1 J D23 C++ # % @ K** TDMGCC NP: Q
% "##@% "@ 1
S
9
=\=Be;7W]&U(2W:[
9eBE9! ^[
_
1: `@ "## Xe..,Y,9.0
a D,-!.,/0 GLUT "6 ABB FA,9B.e FF=E e0E b.,,0=Ae0 .EB;
#d1
2: 5#d6% "1"@%1 I@1 .EB;
*f
http://sourceforge.net/projects/orwelldevcpp/http://sourceforge.net/projects/orwelldevcpp/http://chortle.ccsu.edu/Bloodshed/glutming.ziphttp://chortle.ccsu.edu/Bloodshed/glutming.ziphttp://sourceforge.net/projects/orwelldevcpp/ -
7/23/2019 DEV C++ GLUT
2/8
g6% # 7a: "6 #d 1 I@1 .EB;
4: j "##J #d1 .EBA
Pf
-
7/23/2019 DEV C++ GLUT
3/8
libglut32.a
5: j "#@1 #d1 .
-
7/23/2019 DEV C++ GLUT
4/8
glut32.dll
7: j "#@1 #d1 .EBaP0..
8: j "##J #d1 .EBaP0..
h /BA= "##J %@d % % I#
N nd 1%# D23 C++ GLUT o% @% C "#6#i "
"#@d Oe!GL GLUT 1%#i % "# % %#$ 1%7.
C =,E9Fe p.e 7" #d Oe!GL GLUT: 6"$ I% "#$
Nf
-
7/23/2019 DEV C++ GLUT
5/8
9: q@ @# D23 C++
10: g% 1 "#1#@%1 7"6 % I#: "1 #d1
T " #d 1 @#1 %#% "1 1 "J
7"d 6% 9eFB/!.eF:
#include
const int A = 500; /* length of a side of the monitor window */const float = 500; /* length of a side of the cli!!ing rectangle */const float " = 00; /* length of a side of the s$uare the !rogram draws */
%oid m&init'%oid() gl"lear"olor'0.+ 0.+ 0.+ 0.0(; /* gra& ,ac-ground */
glatriode'GL1234"6738(; /* 7n 9orld coordinates: */ glLoad7dentit&'(; /* !osition the cli!!ing rectangle */ glu3rtho' /+ /+ /+ /(;/* at /+ its right edge at /+ its ,ottom */ glatriode'GL3L?79(; /* edge at / and its to! edge at / */
Kf
-
7/23/2019 DEV C++ GLUT
6/8
@
%oid dis!la&' %oid ()
gl"lear'GL"3L32BB276(; /* clear the window */
glatriode'GL3L?79(; /* 6he following coordinates are e!ressed */
glLoad7dentit&'(; /* in terms of 9orld coordinates */
glegin'GL13LCG38( ; /* draw a filled !ol&gon */ gl"olorDf ' E.0+ 0.D+ 0.(; /* draw in light red */ gl?ertef' "/+ "/ (; /* '+&( */ gl?ertef' "/+ "/ (; /* '+&( */ gl?ertef' "/+ "/ (; /* '+&( */ gl?ertef' "/+ "/ (; /* '+&( */ glnd'(;
glBlush'(; /* send all commands */@
%oid main'int argc+ char** arg%(
) glut7nit'Fargc+arg%(; glut7nit9indowiHe' A+ A (; /* A A !iel screen window */
glut7nitis!la&ode' GL62G I GL678GL(; glut"reate9indow'& 2ectangle(; /* window title */ glutis!la&Bunc'dis!la&(; /* tell 3!enGL main loo! what */ m&init'(; /* set attri,utes */
glutainLoo!'(; /* !ass control to the main loo! */@
11: l%#I r `"6 GLUT 8E!FB
-
7/23/2019 DEV C++ GLUT
7/8
12: g % 6% $ %
13: t#@ W5##W r W5# W
nd !"# $% % " #$# %&'%
W]9,9/; uW]9,9/; uW]9,9/; uh /BA= %@d % % I#
14: g r @
yf
-
7/23/2019 DEV C++ GLUT
8/8
15: 5#6% "@ % @ 1
wf