Mercurial > projects > openmelee
comparison render/render.d @ 28:1cc6b8c0acd2
fixed window close
author | zzzzrrr <mason.green@gmail.com> |
---|---|
date | Mon, 30 Mar 2009 12:48:45 -0400 |
parents | d63faa81a5e4 |
children |
comparison
equal
deleted
inserted
replaced
27:d63faa81a5e4 | 28:1cc6b8c0acd2 |
---|---|
96 bzVec2 screenSize; | 96 bzVec2 screenSize; |
97 bool scaling = false; | 97 bool scaling = false; |
98 bool full = false; | 98 bool full = false; |
99 Settings settings; | 99 Settings settings; |
100 Ship ship1, ship2; | 100 Ship ship1, ship2; |
101 bool running = true; | |
101 | 102 |
102 this(bzWorld world, Ship s1, Ship s2, Human h, Settings settings) { | 103 this(bzWorld world, Ship s1, Ship s2, Human h, Settings settings) { |
103 | 104 |
104 human = h; | 105 human = h; |
105 this.settings = settings; | 106 this.settings = settings; |
124 } | 125 } |
125 | 126 |
126 glfwSetWindowTitle("OpenMelee"); | 127 glfwSetWindowTitle("OpenMelee"); |
127 glfwEnable(GLFW_STICKY_KEYS); | 128 glfwEnable(GLFW_STICKY_KEYS); |
128 | 129 |
130 GLFWkeyfun cbfun; | |
131 cbfun = &key; | |
132 glfwSetKeyCallback(cbfun); | |
129 } | 133 } |
130 | 134 |
131 ~this() { | 135 ~this() { |
132 glfwTerminate(); | 136 glfwTerminate(); |
133 } | 137 } |
135 void update() { | 139 void update() { |
136 // Limit the fps | 140 // Limit the fps |
137 glfwSwapInterval(1); | 141 glfwSwapInterval(1); |
138 draw(); | 142 draw(); |
139 glfwSwapBuffers(); | 143 glfwSwapBuffers(); |
140 } | 144 running = cast(bool) glfwGetWindowParam(GLFW_OPENED); |
141 | |
142 void keys() { | |
143 GLFWkeyfun cbfun; | |
144 cbfun = &key; | |
145 glfwSetKeyCallback(cbfun); | |
146 } | 145 } |
147 | 146 |
148 void drawCircle(bzVec2 center, float radius, bool water = false, float theta = float.nan) | 147 void drawCircle(bzVec2 center, float radius, bool water = false, float theta = float.nan) |
149 { | 148 { |
150 int segs = cast(int)(radius) + 20; | 149 int segs = cast(int)(radius) + 20; |