gambas-source-code/gb.sdl/src/SDLwindow.h
Laurent Carlier 1187559a53 [GB.SDL]
* NEW: Add support for loaded font via SDLttf library (drawing not yet enabled)
* NEW: Add some debugging infos via environment var  DEBUG_GB_SDL
* BUG: Custom cursor (from an image) is currently disabled as it doesn't work yet

Lot of internal clean up and optimisations, not yet finished but things start to take places.



git-svn-id: svn://localhost/gambas/trunk@2243 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-08-17 18:08:56 +00:00

92 lines
2.4 KiB
C++

/***************************************************************************
SDLwindow.h
(c) 2006 Laurent Carlier <lordheavy@users.sourceforge.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************/
#ifndef __SDLWINDOW_H
#define __SDLWINDOW_H
#include "SDL_h.h"
#include "SDLcursor.h"
#include <GL/glx.h>
class SDLwindow
{
public:
SDLwindow(void );
virtual ~SDLwindow();
void Show(void );
void Close(void );
void Refresh();
void Select(void );
void Clear(Uint32 color = 0);
Uint32 Id(void );
int GetWidth(void );
int GetHeight(void );
int GetDepth(void );
char* GetTitle(void ) { return (hTitle); };
SDL_Surface* GetSdlSurface(void ) { return (hSurface); };
// SDLcursor* GetCursor(void ) { return (hCursor); }
void SetX(int );
void SetY(int );
void SetWidth(int );
void SetHeight(int );
void SetFullScreen(bool );
void SetResizable(bool );
void SetTitle(char* );
// void SetCursor(SDLcursor *cursor);
bool IsFullScreen(void ) {return (hFullScreen); };
bool IsResizable(void ) { return (hResizable); };
bool IsShown(void );
// events :)
virtual void Quit(void ) = 0;
virtual void Resize(void ) = 0;
virtual void GotFocus(void ) = 0;
virtual void LostFocus(void ) = 0;
virtual void MouseEnter(void ) = 0;
virtual void MouseLeave(void ) = 0;
virtual void Update(void ) = 0;
virtual void KeyEvent(SDL_KeyboardEvent* , int ) = 0;
virtual void MouseButtonEvent(SDL_MouseButtonEvent* ) = 0;
virtual void MouseMotionEvent(SDL_MouseMotionEvent* ) = 0;
virtual void Open(void ) =0;
private:
SDL_Surface *hSurface;
SDLcursor *hCursor;
int hX, hY;
int hWidth, hHeight;
bool hFullScreen;
bool hResizable;
char* hTitle;
// context and drawable (for GlxMakeCurrent)
GLXContext hCtx;
GLXDrawable hDrw;
Display *hDpy;
};
#endif /* __SDLWINDOW_H */