/
OpenGLSanityCheck.st
64 lines (52 loc) · 1.32 KB
/
OpenGLSanityCheck.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
'From Cuis 5.0 [latest update: #3960] on 24 November 2019 at 7:26:56 pm'!
!classDefinition: #OpenGLTest category: #OpenGLTest!
Object subclass: #OpenGLTest
instanceVariableNames: 'gl'
classVariableNames: ''
poolDictionaries: 'OpenGLConstants'
category: 'OpenGLTest'!
!OpenGLTest methodsFor: 'as yet unclassified' stamp: 'pb 11/24/2019 18:56:39'!
glDestroy
gl destroy ! !
!OpenGLTest methodsFor: 'as yet unclassified' stamp: 'pb 11/24/2019 19:02:08'!
glInitialize
gl _ OpenGL newIn: (50 @ 50 corner: 300 @ 300).
gl
glClearColor: 0.3
with: 0.3
with: 0.7
with: 1.0;
glClear: GLColorBufferBit + GLDepthBufferBit;
glBegin: GLTriangles;
glColor3f: 1.0
with: 0.0
with: 0.0;
glVertex3f: -0.5
with: 0.0
with: 0.0;
glColor3f: 0.0
with: 1.0
with: 0.0;
glVertex3f: 0.5
with: 0.0
with: 0.0;
glColor3f: 0.0
with: 0.0
with: 0.5;
glVertex3f: 0.0
with: 1.0
with: 0.0;
glEnd;
swapBuffers;
checkForErrors.! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
!classDefinition: 'OpenGLTest class' category: #OpenGLTest!
OpenGLTest class
instanceVariableNames: ''!
!OpenGLTest class methodsFor: 'as yet unclassified' stamp: 'pb 11/24/2019 19:23:53'!
demo
| newGl |
newGl _ self new.
newGl glInitialize.
(Delay forSeconds: 3) wait.
newGl glDestroy.! !