FreeBASIC  0.91.0
gfx_driver_ddraw.c File Reference
#include "../fb_gfx.h"
#include "fb_gfx_win32.h"
#include <objbase.h>
#include <ddraw.h>
#include <dinput.h>
Include dependency graph for gfx_driver_ddraw.c:

Go to the source code of this file.

Data Structures

struct  MODESLIST
 
struct  DEVENUMDATA
 

Macros

#define DX_GUID(id, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)   static const GUID id = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
 

Typedefs

typedef struct MODESLIST MODESLIST
 
typedef struct DEVENUMDATA DEVENUMDATA
 
typedef HRESULT(WINAPI * DIRECTDRAWCREATE )(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter)
 
typedef HRESULT(WINAPI * DIRECTINPUTCREATE )(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT *lplpDI, LPUNKNOWN pUnkOuter)
 
typedef HRESULT(WINAPI * DIRECTDRAWENUMERATEEX )(LPDDENUMCALLBACKEX lpCallback, LPVOID lpContext, DWORD dwFlags)
 

Functions

 DX_GUID (__fb_IID_IDirectDraw2, 0xB3A6F3E0, 0x2B43, 0x11CF, 0xA2, 0xDE, 0x00, 0xAA, 0x00, 0xB9, 0x33, 0x56)
 
 DX_GUID (__fb_GUID_Key, 0x55728220, 0xD33C, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
 DX_GUID (__fb_GUID_SysKeyboard, 0x6F1D2B61, 0xD5A0, 0x11CF, 0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00)
 
static int driver_init (char *title, int w, int h, int depth, int refresh_rate, int flags)
 
static void driver_wait_vsync (void)
 
static int * driver_fetch_modes (int depth, int *size)
 
static int directx_init (void)
 
static void directx_exit (void)
 
static void restore_surfaces (void)
 
static void directx_paint (void)
 
static int calc_comp_height (int h)
 
static BOOL WINAPI ddenum_callback (GUID FAR *lpGUID, LPSTR lpDriverDescription, LPSTR lpDriverName, LPVOID lpContext, HMONITOR hm)
 
static DWORD WINAPI directx_thread (LPVOID param)
 
static HRESULT CALLBACK fetch_modes_callback (LPDDSURFACEDESC desc, LPVOID data)
 

Variables

GFXDRIVER fb_gfxDriverDirectDraw
 
static DIOBJECTDATAFORMAT __c_rgodfDIKeyboard [256]
 
static const DIDATAFORMAT __c_dfDIKeyboard = { 24, 16, 0x2, 256, 256, __c_rgodfDIKeyboard }
 
static HMODULE dd_library
 
static HMODULE di_library
 
static LPDIRECTDRAW2 lpDD = NULL
 
static LPDIRECTDRAWSURFACE lpDDS
 
static LPDIRECTDRAWSURFACE lpDDS_back
 
static LPDIRECTDRAWPALETTE lpDDP
 
static LPDIRECTINPUT lpDI
 
static LPDIRECTINPUTDEVICE lpDID
 
static RECT rect
 
static int win_x
 
static int win_y
 
static int display_offset
 
static int wait_vsync = FALSE
 
static HANDLE vsync_event = NULL
 

Macro Definition Documentation

#define DX_GUID (   id,
  l,
  w1,
  w2,
  b1,
  b2,
  b3,
  b4,
  b5,
  b6,
  b7,
  b8 
)    static const GUID id = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}

Definition at line 17 of file gfx_driver_ddraw.c.

Typedef Documentation

typedef struct DEVENUMDATA DEVENUMDATA
typedef HRESULT(WINAPI * DIRECTDRAWCREATE)(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter)

Definition at line 63 of file gfx_driver_ddraw.c.

typedef HRESULT(WINAPI * DIRECTDRAWENUMERATEEX)(LPDDENUMCALLBACKEX lpCallback, LPVOID lpContext, DWORD dwFlags)

Definition at line 65 of file gfx_driver_ddraw.c.

typedef HRESULT(WINAPI * DIRECTINPUTCREATE)(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUT *lplpDI, LPUNKNOWN pUnkOuter)

Definition at line 64 of file gfx_driver_ddraw.c.

typedef struct MODESLIST MODESLIST

Function Documentation

static int calc_comp_height ( int  h)
static

Definition at line 140 of file gfx_driver_ddraw.c.

Here is the caller graph for this function:

static BOOL WINAPI ddenum_callback ( GUID FAR *  lpGUID,
LPSTR  lpDriverDescription,
LPSTR  lpDriverName,
LPVOID  lpContext,
HMONITOR  hm 
)
static

Definition at line 156 of file gfx_driver_ddraw.c.

Here is the caller graph for this function:

static void directx_exit ( void  )
static

Definition at line 345 of file gfx_driver_ddraw.c.

Here is the caller graph for this function:

static int directx_init ( void  )
static

Definition at line 167 of file gfx_driver_ddraw.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void directx_paint ( void  )
static

Definition at line 115 of file gfx_driver_ddraw.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static DWORD WINAPI directx_thread ( LPVOID  param)
static

Definition at line 411 of file gfx_driver_ddraw.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int * driver_fetch_modes ( int  depth,
int *  size 
)
static

Definition at line 518 of file gfx_driver_ddraw.c.

Here is the call graph for this function:

static int driver_init ( char *  title,
int  w,
int  h,
int  depth,
int  refresh_rate,
int  flags 
)
static

Definition at line 474 of file gfx_driver_ddraw.c.

Here is the call graph for this function:

static void driver_wait_vsync ( void  )
static

Definition at line 491 of file gfx_driver_ddraw.c.

Here is the call graph for this function:

DX_GUID ( __fb_IID_IDirectDraw2  ,
0xB3A6F3E0  ,
0x2B43  ,
0x11CF  ,
0xA2  ,
0xDE  ,
0x00  ,
0xAA  ,
0x00  ,
0xB9  ,
0x33  ,
0x56   
)
DX_GUID ( __fb_GUID_Key  ,
0x55728220  ,
0xD33C  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
DX_GUID ( __fb_GUID_SysKeyboard  ,
0x6F1D2B61  ,
0xD5A0  ,
0x11CF  ,
0xBF  ,
0xC7  ,
0x44  ,
0x45  ,
0x53  ,
0x54  ,
0x00  ,
0x00   
)
static HRESULT CALLBACK fetch_modes_callback ( LPDDSURFACEDESC  desc,
LPVOID  data 
)
static

Definition at line 502 of file gfx_driver_ddraw.c.

Here is the caller graph for this function:

static void restore_surfaces ( void  )
static

Definition at line 85 of file gfx_driver_ddraw.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const DIDATAFORMAT __c_dfDIKeyboard = { 24, 16, 0x2, 256, 256, __c_rgodfDIKeyboard }
static

Definition at line 72 of file gfx_driver_ddraw.c.

DIOBJECTDATAFORMAT __c_rgodfDIKeyboard[256]
static

Definition at line 71 of file gfx_driver_ddraw.c.

HMODULE dd_library
static

Definition at line 73 of file gfx_driver_ddraw.c.

HMODULE di_library
static

Definition at line 74 of file gfx_driver_ddraw.c.

int display_offset
static

Definition at line 82 of file gfx_driver_ddraw.c.

LPDIRECTDRAW2 lpDD = NULL
static

Definition at line 75 of file gfx_driver_ddraw.c.

LPDIRECTDRAWPALETTE lpDDP
static

Definition at line 78 of file gfx_driver_ddraw.c.

LPDIRECTDRAWSURFACE lpDDS
static

Definition at line 76 of file gfx_driver_ddraw.c.

LPDIRECTDRAWSURFACE lpDDS_back
static

Definition at line 77 of file gfx_driver_ddraw.c.

LPDIRECTINPUT lpDI
static

Definition at line 79 of file gfx_driver_ddraw.c.

LPDIRECTINPUTDEVICE lpDID
static

Definition at line 80 of file gfx_driver_ddraw.c.

RECT rect
static

Definition at line 81 of file gfx_driver_ddraw.c.

HANDLE vsync_event = NULL
static

Definition at line 83 of file gfx_driver_ddraw.c.

int wait_vsync = FALSE
static

Definition at line 82 of file gfx_driver_ddraw.c.

int win_x
static

Definition at line 82 of file gfx_driver_ddraw.c.

int win_y
static

Definition at line 82 of file gfx_driver_ddraw.c.