2 import arsd
.simpledisplay
;
9 // ////////////////////////////////////////////////////////////////////////// //
10 void main (string
[] args
) {
11 glconShowKey
= "M-Grave";
13 conProcessQueue(); // load config
14 conProcessArgs
!true(args
);
17 oglSetupDG
= delegate () {
18 // this will create texture
19 //gxResize(glconCtlWindow.width, glconCtlWindow.height);
23 redrawFrameDG
= delegate () {
24 oglSetup2D(glconCtlWindow
.width
, glconCtlWindow
.height
);
26 glMatrixMode(GL_PROJECTION);
28 glOrtho(0, /*winWidth*/100, /*winHeight*/100, 0, -1, 1); // set origin to top left
29 glMatrixMode(GL_MODELVIEW);
33 glClearColor(0, 0, 0, 0);
34 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_ACCUM_BUFFER_BIT|GL_STENCIL_BUFFER_BIT
);
37 glMatrixMode(GL_MODELVIEW
);
40 glColor4f(1, 1, 1, 1);
46 glColor4f(1, 1, 0, 0.8);
47 glEnable(GL_BLEND
); // other things was set in `oglSetup2D()`
50 glEnable(GL_POINT_SMOOTH
); // so our point will be "smoothed" to circle
53 glDisable(GL_LINE_SMOOTH
);
60 // rebuild main screen (do any calculations we might need)
61 nextFrameDG
= delegate () {
64 keyEventDG
= delegate (KeyEvent event
) {
65 if (!event
.pressed
) return;
67 case Key
.Escape
: concmd("quit"); break;
72 mouseEventDG
= delegate (MouseEvent event
) {
75 charEventDG
= delegate (dchar ch
) {
76 if (ch
== 'q') { concmd("quit"); return; }
79 resizeEventDG
= delegate (int wdt
, int hgt
) {
84 sdpyWindowClass
= "SDPY WINDOW";
85 auto sdwin
= new SimpleWindow(VBufWidth
, VBufHeight
, "My D App", OpenGlOptions
.yes
, Resizability
.allowResizing
);
87 glconSetupForGLWindow(sdwin
);
90 conProcessQueue(int.max
/4);
93 glconRunGLWindowResizeable(1024, 768, "My D App", "SDPY WINDOW");