• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#windowsobjective-ccocoaqtpython誰得phprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Cross-Platform OpenGL Windowing Library


コミットメタ情報

リビジョン48ce2df0e008b494439a5d82d131385b21b14227 (tree)
日時2018-10-24 10:34:37
作者AlaskanEmily <emily@alas...>
コミッターAlaskanEmily

ログメッセージ

Fix some formatting

変更サマリ

差分

--- a/glow_x11.c
+++ b/glow_x11.c
@@ -48,6 +48,8 @@ static Display *glow_get_display(){
4848 return NULL;
4949 }
5050
51+/******************************************************************************/
52+
5153 static const GLint glow_attribs[] = {
5254 GLX_X_RENDERABLE, True,
5355 GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
@@ -62,6 +64,8 @@ static const GLint glow_attribs[] = {
6264 None
6365 };
6466
67+/******************************************************************************/
68+
6569 struct Glow_Context {
6670 unsigned char gl[2];
6771 Display *dpy;
@@ -69,6 +73,8 @@ struct Glow_Context {
6973 GLXContext ctx;
7074 };
7175
76+/******************************************************************************/
77+
7278 struct Glow_Window{
7379
7480 Display *dpy;
@@ -86,16 +92,22 @@ struct Glow_Window{
8692 int mouse_x, mouse_y;
8793 };
8894
95+/******************************************************************************/
96+
8997 unsigned Glow_WindowStructSize(){
9098 return sizeof(struct Glow_Window);
9199 }
92100
101+/******************************************************************************/
102+
93103 void Glow_ViewportSize(unsigned w, unsigned h,
94104 unsigned *out_w, unsigned *out_h){
95105 out_w[0] = w;
96106 out_h[0] = h;
97107 }
98108
109+/******************************************************************************/
110+
99111 void Glow_CreateWindow(struct Glow_Window *window,
100112 unsigned w, unsigned h, const char *title, int flags){
101113
@@ -192,6 +204,8 @@ void Glow_CreateWindow(struct Glow_Window *window,
192204 XSync(window->dpy, False);
193205 }
194206
207+/******************************************************************************/
208+
195209 void Glow_DestroyWindow(struct Glow_Window *window){
196210 XSync(window->dpy, False);
197211
@@ -205,10 +219,14 @@ void Glow_DestroyWindow(struct Glow_Window *window){
205219 XCloseDisplay(window->dpy);
206220 }
207221
222+/******************************************************************************/
223+
208224 void Glow_SetTitle(struct Glow_Window *window, const char *title){
209225 XStoreName(window->dpy, window->wnd, title);
210226 }
211227
228+/******************************************************************************/
229+
212230 void Glow_ShowWindow(struct Glow_Window *window){
213231 XClearWindow(window->dpy, window->wnd);
214232 XMapRaised(window->dpy, window->wnd);
@@ -220,16 +238,22 @@ void Glow_ShowWindow(struct Glow_Window *window){
220238 }
221239 }
222240
241+/******************************************************************************/
242+
223243 void Glow_HideWindow(struct Glow_Window *window){
224244 XUnmapWindow(window->dpy, window->wnd);
225245 }
226246
247+/******************************************************************************/
248+
227249 void Glow_GetWindowSize(const struct Glow_Window *window,
228250 unsigned *out_w, unsigned *out_h){
229251 out_w[0] = window->w;
230252 out_h[0] = window->h;
231253 }
232254
255+/******************************************************************************/
256+
233257 void Glow_FlipScreen(struct Glow_Window *window){
234258 Glow_MakeCurrent(window->ctx);
235259 glFlush();
@@ -237,6 +261,8 @@ void Glow_FlipScreen(struct Glow_Window *window){
237261 glClear(GL_COLOR_BUFFER_BIT);
238262 }
239263
264+/******************************************************************************/
265+
240266 static unsigned glow_get_event(struct Glow_Window *window,
241267 unsigned block, struct Glow_Event *out){
242268 glow_get_event_start:
@@ -297,18 +323,27 @@ glow_get_event_start:
297323 return 0;
298324 }
299325
326+/******************************************************************************/
327+
300328 unsigned Glow_GetEvent(struct Glow_Window *window,
301329 struct Glow_Event *out_event){
302330 return glow_get_event(window, 0, out_event);
331+
303332 }
333+/******************************************************************************/
334+
304335 void Glow_WaitEvent(struct Glow_Window *window, struct Glow_Event *out_event){
305336 glow_get_event(window, 1, out_event);
306337 }
307338
339+/******************************************************************************/
340+
308341 unsigned Glow_ContextStructSize(){
309342 return sizeof(struct Glow_Context);
310343 }
311344
345+/******************************************************************************/
346+
312347 int Glow_CreateContext(struct Glow_Window *window,
313348 struct Glow_Context *opt_share,
314349 unsigned major, unsigned minor,
@@ -360,20 +395,28 @@ int Glow_CreateContext(struct Glow_Window *window,
360395 return 0;
361396 }
362397
398+/******************************************************************************/
399+
363400 struct Glow_Context *Glow_GetContext(
364401 struct Glow_Window *window){
365402 return window->ctx;
366403 }
367404
405+/******************************************************************************/
406+
368407 void Glow_CreateLegacyContext(struct Glow_Window *window,
369408 struct Glow_Context *out){
370409 Glow_CreateContext(window, NULL, 2, 1, out);
371410 }
372411
412+/******************************************************************************/
413+
373414 void Glow_MakeCurrent(struct Glow_Context *ctx){
374415 glXMakeCurrent(ctx->dpy, ctx->wnd, ctx->ctx);
375416 }
376417
418+/******************************************************************************/
419+
377420 struct Glow_Window *Glow_CreateLegacyWindow(unsigned w, unsigned h,
378421 const char *title){
379422