summaryrefslogtreecommitdiffstatsci
path: root/src/glx.cpp
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2013-11-27 19:03:25 -0800
committerBryce Harrington <b.harrington@samsung.com>2013-11-27 19:03:25 -0800
commit41f692367fff20ad69973f21d92ffe24bea73276 (patch)
treefcc9d8c48919c1b1d2ae9770fa0b94ab54f73519 /src/glx.cpp
parentb5ed7231729463b73c603632dd35cabab787a68e (diff)
Indent 4 spaces instead of 2
Diffstat (limited to 'src/glx.cpp')
-rw-r--r--src/glx.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/glx.cpp b/src/glx.cpp
index 365c25f..4a18876 100644
--- a/src/glx.cpp
+++ b/src/glx.cpp
@@ -6,63 +6,63 @@
bool
createGLXContextAndWindow(glx_state_t *state, int width, int height)
{
- int rgba_attribs[] = {
- GLX_RGBA,
- GLX_RED_SIZE, 1,
- GLX_GREEN_SIZE, 1,
- GLX_BLUE_SIZE, 1,
- GLX_ALPHA_SIZE, 1,
- GLX_DOUBLEBUFFER,
- None
- };
- XVisualInfo *visinfo;
- XSetWindowAttributes xattr;
+ int rgba_attribs[] = {
+ GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ GLX_ALPHA_SIZE, 1,
+ GLX_DOUBLEBUFFER,
+ None
+ };
+ XVisualInfo *visinfo;
+ XSetWindowAttributes xattr;
- state->dpy = XOpenDisplay (NULL);
- if (state->dpy == NULL) {
- warnx ("Failed to open display: %s\n", XDisplayName (0));
- return false;
- }
+ state->dpy = XOpenDisplay (NULL);
+ if (state->dpy == NULL) {
+ warnx ("Failed to open display: %s\n", XDisplayName (0));
+ return false;
+ }
- visinfo = glXChooseVisual (state->dpy, DefaultScreen (state->dpy), rgba_attribs);
- if (visinfo == NULL) {
- warnx ("Failed to create RGBA and double-buffered visuals\n");
- XCloseDisplay (state->dpy);
- return NULL;
- }
+ visinfo = glXChooseVisual (state->dpy, DefaultScreen (state->dpy), rgba_attribs);
+ if (visinfo == NULL) {
+ warnx ("Failed to create RGBA and double-buffered visuals\n");
+ XCloseDisplay (state->dpy);
+ return NULL;
+ }
- xattr.colormap = XCreateColormap (state->dpy,
- RootWindow (state->dpy, visinfo->screen),
- visinfo->visual, AllocNone);
- xattr.border_pixel = 0;
- state->window = XCreateWindow (state->dpy,
- DefaultRootWindow (state->dpy),
- 100, 50,
- width, height, 0, visinfo->depth,
- InputOutput, visinfo->visual,
- CWBorderPixel | CWColormap,
- &xattr);
- XMapWindow (state->dpy, state->window);
+ xattr.colormap = XCreateColormap (state->dpy,
+ RootWindow (state->dpy, visinfo->screen),
+ visinfo->visual, AllocNone);
+ xattr.border_pixel = 0;
+ state->window = XCreateWindow (state->dpy,
+ DefaultRootWindow (state->dpy),
+ 100, 50,
+ width, height, 0, visinfo->depth,
+ InputOutput, visinfo->visual,
+ CWBorderPixel | CWColormap,
+ &xattr);
+ XMapWindow (state->dpy, state->window);
- state->glx_context = glXCreateContext (state->dpy, visinfo, NULL, True);
- XFree (visinfo);
+ state->glx_context = glXCreateContext (state->dpy, visinfo, NULL, True);
+ XFree (visinfo);
- if (state->glx_context == NULL) {
- warnx ("Could not create glx context\n");
- XCloseDisplay (state->dpy);
- return false;
- }
+ if (state->glx_context == NULL) {
+ warnx ("Could not create glx context\n");
+ XCloseDisplay (state->dpy);
+ return false;
+ }
- return true;
+ return true;
}
void
destroyGLXContextAndWindow (glx_state_t *state)
{
- if (state->dpy) {
- glXDestroyContext (state->dpy, state->glx_context);
+ if (state->dpy) {
+ glXDestroyContext (state->dpy, state->glx_context);
- XDestroyWindow (state->dpy, state->window);
- XCloseDisplay (state->dpy);
- }
+ XDestroyWindow (state->dpy, state->window);
+ XCloseDisplay (state->dpy);
+ }
}