Skip to content

Commit

Permalink
Added stubs for the needed unix window management code.
Browse files Browse the repository at this point in the history
  • Loading branch information
danij committed Jun 29, 2007
1 parent e03acdf commit 8f5227b
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 21 deletions.
33 changes: 29 additions & 4 deletions doomsday/engine/unix/include/dd_uinit.h
Expand Up @@ -31,16 +31,41 @@

#include "dd_pinit.h"

// Doomsday window flags.
#define DDWF_VISIBLE 0x01
#define DDWF_FULLSCREEN 0x02
#define DDWF_CENTER 0x04

// Flags for DD_SetWindow()
#define DDSW_NOSIZE 0x01
#define DDSW_NOMOVE 0x02
#define DDSW_NOBPP 0x04
#define DDSW_NOFULLSCREEN 0x08
#define DDSW_NOVISIBLE 0x10
#define DDSW_NOCENTER 0x20
#define DDSW_NOCHANGES (DDSW_NOSIZE & DDSW_NOMOVE & DDSW_NOBPP & \
DDSW_NOFULLSCREEN & DDSW_NOVISIBLE & \
DDSW_NOCENTER)

typedef struct {
int placeHolder;
} application_t;

extern uint windowIDX; // Main window.
extern application_t app;

uint DD_CreateWindow(application_t *app, uint parent,
int x, int y, int w, int h, int bpp, int flags,
const char *title, int cmdShow);
void DD_DestroyWindow(uint idx);
boolean DD_DestroyWindow(uint idx);

boolean DD_GetWindowDimensions(uint idx, int *x, int *y, int *w, int *h);
boolean DD_GetWindowBPP(uint idx);
boolean DD_IsWindowFullscreen(uint idx);
boolean DD_SetWindowVisibility(uint idx, boolean show);
boolean DD_GetWindowBPP(uint idx, int *bpp);
boolean DD_GetWindowFullscreen(uint idx, boolean *fullscreen);
boolean DD_GetWindowVisibility(uint idx, boolean *show);

boolean DD_SetWindow(uint idx, int x, int y, int w, int h, int bpp,
uint wflags, uint uflags);

void DD_Shutdown(void);

Expand Down
62 changes: 45 additions & 17 deletions doomsday/engine/unix/src/dd_uinit.c
Expand Up @@ -55,14 +55,8 @@

// TYPES -------------------------------------------------------------------

// Doomsday window flags.
#define DDWF_VISIBLE 0x01
#define DDWF_FULLSCREEN 0x02

typedef struct {
int flags;
int x, y, width, height;
int bpp;
int placeHolder;
} ddwindow_t;

// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
Expand Down Expand Up @@ -207,28 +201,62 @@ int LoadPlugin(const char *pluginPath, lt_ptr data)
#endif
*/

ddwindow_t *DD_GetWindow(uint idx)
uint DD_CreateWindow(application_t *app, uint parentIDX,
int x, int y, int w, int h, int bpp, int flags,
const char *title, int cmdShow)
{
// \fixme Not implemented.
return 0;
}

boolean DD_DestroyWindow(uint idx)
{
// \fixme Not implemented.
return true;
}

boolean DD_SetWindow(uint idx, int newX, int newY, int newWidth, int newHeight,
int newBPP, uint wFlags, uint uFlags)
{
// Window paramaters are not changeable in dedicated mode.
if(isDedicated)
return false;

if(uFlags & DDSW_NOCHANGES)
return true; // Nothing to do.

// \fixme Not implemented.
return true;
}

boolean DD_GetWindowDimensions(uint idx, int *x, int *y, int *width, int *height)
{
// Not in dedicated mode.
if(isDedicated)
return false;

// \fixme Not implemented.
return NULL;
return true;
}

void DD_ChangeWindowDimensions(ddwindow_t *window, int x, int y, int width,
int height)
boolean DD_GetWindowBPP(uint idx, int *bpp)
{
if(!window)
return;
// Not in dedicated mode.
if(isDedicated)
return false;

// \fixme Not implemented.
return true;
}

void DD_WindowShow(ddwindow_t *window, boolean show)
boolean DD_GetWindowFullscreen(uint idx, boolean *fullscreen)
{
if(!window)
return;
// Not in dedicated mode.
if(isDedicated)
return false;

// \fixme Not implemented.
return;
return true;
}

int LoadPlugin(const char *pluginPath, lt_ptr data)
Expand Down

0 comments on commit 8f5227b

Please sign in to comment.