/*-----------------------------------------------------------------
LOG
    GEM - Graphics Environment for Multimedia

    create a window

    Copyright (c) 1997-1998 Mark Danks.
    For information on usage and redistribution, and for a DISCLAIMER OF ALL
    WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.

-----------------------------------------------------------------*/

#ifndef INCLUDE_GEMWINCREATE_H_
#define INCLUDE_GEMWINCREATE_H_

#ifdef _UNIX_

#include <GL/glx.h>

/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
    WindowInfo
    
    All of the relavent information about an OpenGL window

DESCRIPTION
    
-----------------------------------------------------------------*/
struct WindowInfo
{
    Display     *dpy;
    Window      win;
    Colormap    cmap;
    GLXContext  context;
};

#elif _WINDOWS

#include <windows.h>

struct WindowInfo
{
    HWND        win;
    HDC         dc;
    HGLRC       context;
};

#else

#error Need to specifiy an OS dependent window creation

#endif

/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
    WindowHints
    
    Hints for window creation

DESCRIPTION
    
-----------------------------------------------------------------*/
struct WindowHints
{
    int         actuallyDisplay;
    int         buffer;
    int         width;
    int         height;
#ifdef _UNIX_
    GLXContext  shared;
#elif _WINDOWS
    HGLRC       shared;
#endif
};



//////////
// Create a new window
extern int createGemWindow(WindowInfo &info, WindowHints &hints);

//////////
// Destroy a window
extern void destroyGemWindow(WindowInfo &info);

#endif  // for header file
