Shadowrun: Awakened 29 September 2011 - Build 871
Functions | Variables
xvideo.cpp File Reference
#include "video.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <sys/time.h>
#include <signal.h>
#include <pthread.h>
#include <errno.h>
#include <X11/extensions/XShm.h>
#include <sys/ipc.h>
#include <sys/shm.h>
Include dependency graph for xvideo.cpp:

Go to the source code of this file.

Functions

void mask2bits (unsigned int mask, unsigned int &save, char &shift)
int xerr_handler (Display *, XErrorEvent *error)

Variables

Atom _XA_WM_DELETE_WINDOW = 0
static Colormap cmap
static int dispdepth = 0
static char * display_name = NULL
static Display * dpy = NULL
static int g_fps = 0
static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER
static unsigned int * g_pImg = 0
static int g_sizex
static int g_sizey
struct timeval g_time
static videog_video = 0
static GC gc
static Pixmap pixmap = 0
static Window rootW
static Screen * scrn
static XShmSegmentInfo shmseginfo
static int vidtype = 3
static Visual * vis
static Window win
static int x_error = 0
static XGCValues xgcv
static XImage * ximage

Function Documentation

void mask2bits ( unsigned int  mask,
unsigned int &  save,
char &  shift 
) [inline]

Definition at line 82 of file xvideo.cpp.

References dispdepth.

{
    save  = mask; if(!mask) { shift = dispdepth/3; return; }
    shift = 0; while(!(mask&1)) ++shift, mask >>= 1;
    int bits = 0; while(mask&1) ++bits,  mask >>= 1;
    shift += bits - 8;
}
int xerr_handler ( Display *  ,
XErrorEvent *  error 
)

Definition at line 90 of file xvideo.cpp.

References video::running, and x_error.

{
    x_error = error->error_code;
    if(g_video) g_video->running = false;
    return 0;
}

Variable Documentation

Definition at line 72 of file xvideo.cpp.

Colormap cmap [static]

Definition at line 58 of file xvideo.cpp.

int dispdepth = 0 [static]

Definition at line 61 of file xvideo.cpp.

Referenced by mask2bits().

char* display_name = NULL [static]

Definition at line 54 of file xvideo.cpp.

Display* dpy = NULL [static]

Definition at line 55 of file xvideo.cpp.

int g_fps = 0 [static]

Definition at line 69 of file xvideo.cpp.

pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER [static]

Definition at line 71 of file xvideo.cpp.

unsigned int* g_pImg = 0 [static]

Definition at line 68 of file xvideo.cpp.

int g_sizex [static]

Definition at line 66 of file xvideo.cpp.

int g_sizey

Definition at line 66 of file xvideo.cpp.

struct timeval g_time

Definition at line 70 of file xvideo.cpp.

video* g_video = 0 [static]

Definition at line 67 of file xvideo.cpp.

GC gc [static]

Definition at line 59 of file xvideo.cpp.

Pixmap pixmap = 0 [static]

Definition at line 52 of file xvideo.cpp.

Window rootW

Definition at line 60 of file xvideo.cpp.

Screen* scrn [static]

Definition at line 56 of file xvideo.cpp.

XShmSegmentInfo shmseginfo [static]

Definition at line 51 of file xvideo.cpp.

int vidtype = 3 [static]

Definition at line 65 of file xvideo.cpp.

Visual* vis [static]

Definition at line 57 of file xvideo.cpp.

Window win [static]

Definition at line 60 of file xvideo.cpp.

int x_error = 0 [static]

Definition at line 64 of file xvideo.cpp.

Referenced by xerr_handler().

XGCValues xgcv [static]

Definition at line 62 of file xvideo.cpp.

XImage* ximage [static]

Definition at line 63 of file xvideo.cpp.


Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net