~ghartshaw/+junk/terrain-gen

« back to all changes in this revision

Viewing changes to src/x11/functions.hpp

  • Committer: Garrett Hartshaw
  • Date: 2011-02-06 23:30:01 UTC
  • Revision ID: ghartshaw@gmail.com-20110206233001-4hxdsn7o2t44woth
Added error::xlib_error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef X11_FUNCTIONS_20110204
20
20
#define X11_FUNCTIONS_20110204
21
21
 
 
22
#include "error/xlib_error.hpp"
 
23
 
22
24
#include <GL/glew.h>
23
25
#include <GL/glx.h>
24
26
 
29
31
  Display * dpy = XOpenDisplay( screen );
30
32
  if ( !dpy )
31
33
  {
32
 
    throw error::error( "XOpenDisplay failed." );
 
34
    throw error::xlib_error( "XOpenDisplay failed." );
33
35
  }
34
36
  return dpy;
35
37
}
50
52
                              InputOutput, vi->visual, mask, swa );
51
53
  if ( !wnd )
52
54
  {
53
 
    throw error::error( "XCreateWindow failed" );
 
55
    throw error::xlib_error( "XCreateWindow failed" );
54
56
  }
55
57
  XStoreName( dpy, wnd, title.c_str() );
56
58
  char const * atom = "WM_DELETE_WINDOW";
57
59
  Atom wmDelete = XInternAtom( dpy, atom, true );
58
60
  if ( wmDelete == None )
59
61
  {
60
 
    throw error::error( "XInternAtom failed" );
 
62
    throw error::xlib_error( "XInternAtom failed" );
61
63
  }
62
64
  XSetWMProtocols( dpy, wnd, &wmDelete, true );
63
65
  return wnd;