Source

Fireplace / FPX11Display.h

#import <X11/Xlib.h>
#import <Foundation/Foundation.h>

#define DEBUG_ACTIVE_CONTEXT 1

#if DEBUG_ACTIVE_CONTEXT
#import <GL/glx.h>
#endif

@interface FPX11Display : NSObject
{
	Display * _display;

#if DEBUG_ACTIVE_CONTEXT
	GLXContext _glxContextContext;
	Window _glxContextWindow;
	NSString * _glxContextName;
#endif
}
+(FPX11Display*)mainDisplayWithDisplayName:(NSString*)displayName;
+(FPX11Display*)mainDisplay;
-(id)initWithDisplayName:(NSString*)displayName;
-(Display*)display;
-(int)screen;
-(int)widthForScreen:(int)screen;
-(int)heightForScreen:(int)screen;
-(Window)rootWindowForScreen:(int)screen;
-(int)width;
-(int)height;
-(Window)rootWindow;
-(Visual*)visual;
-(int)depth;
-(Colormap)colormap;
-(void)makeCurrentContext:(GLXContext)glxContext
                 onWindow:(Window)x11Window
              contextName:(NSString*)name;
#if DEBUG_ACTIVE_CONTEXT
-(NSString*)glxContextName;
#endif
@end