diff --git a/Makefile.am b/Makefile.am index 2aee973e4..0bf5a878e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,7 @@ SUBDIRS = \ @pcre_dir@ \ @sdl_dir@ \ @sdlsound_dir@ \ + @sdl2_dir@ \ @libxml_dir@ \ @xml_dir@ \ @v4l_dir@ \ diff --git a/configure.ac b/configure.ac index daa5548fb..57d9bd000 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,7 @@ GB_CONFIG_SUBDIRS(mime, gb.mime) GB_CONFIG_SUBDIRS(pcre, gb.pcre) GB_CONFIG_SUBDIRS(sdl, gb.sdl) GB_CONFIG_SUBDIRS(sdlsound, gb.sdl.sound) +GB_CONFIG_SUBDIRS(sdl2, gb.sdl2) GB_CONFIG_SUBDIRS(libxml, gb.libxml) GB_CONFIG_SUBDIRS(xml, gb.xml) GB_CONFIG_SUBDIRS(v4l, gb.v4l) diff --git a/gb.sdl2/AUTHORS b/gb.sdl2/AUTHORS new file mode 100644 index 000000000..27dce17c9 --- /dev/null +++ b/gb.sdl2/AUTHORS @@ -0,0 +1,6 @@ +Codes/ideas/contributions (in alphabetic order): + +Fabien Bodard +Daniel Campos FernànDez +Laurent Carlier +Benoît Minisini diff --git a/gb.sdl2/COPYING b/gb.sdl2/COPYING new file mode 120000 index 000000000..012065c85 --- /dev/null +++ b/gb.sdl2/COPYING @@ -0,0 +1 @@ +../COPYING \ No newline at end of file diff --git a/gb.sdl2/ChangeLog b/gb.sdl2/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/gb.sdl2/INSTALL b/gb.sdl2/INSTALL new file mode 120000 index 000000000..99d491b4f --- /dev/null +++ b/gb.sdl2/INSTALL @@ -0,0 +1 @@ +../INSTALL \ No newline at end of file diff --git a/gb.sdl2/Makefile.am b/gb.sdl2/Makefile.am new file mode 100644 index 000000000..f81e75753 --- /dev/null +++ b/gb.sdl2/Makefile.am @@ -0,0 +1,3 @@ +ACLOCAL_AMFLAGS = -I m4 --install +SUBDIRS = @SDL2_DIR@ +EXTRA_DIST = reconf spec gambas.h gb*.h diff --git a/gb.sdl2/NEWS b/gb.sdl2/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/gb.sdl2/README b/gb.sdl2/README new file mode 100644 index 000000000..e69de29bb diff --git a/gb.sdl2/acinclude.m4 b/gb.sdl2/acinclude.m4 new file mode 120000 index 000000000..d84c32a31 --- /dev/null +++ b/gb.sdl2/acinclude.m4 @@ -0,0 +1 @@ +../acinclude.m4 \ No newline at end of file diff --git a/gb.sdl2/component.am b/gb.sdl2/component.am new file mode 120000 index 000000000..2f0eee34f --- /dev/null +++ b/gb.sdl2/component.am @@ -0,0 +1 @@ +../component.am \ No newline at end of file diff --git a/gb.sdl2/configure.ac b/gb.sdl2/configure.ac new file mode 100644 index 000000000..4495eeef7 --- /dev/null +++ b/gb.sdl2/configure.ac @@ -0,0 +1,20 @@ +dnl ---- configure.ac for gb.sdl + +m4_include([../version.m4]) +AC_INIT(gambas3-gb-sdl2, GB_VERSION, GB_MAIL, [], GB_URL) +AC_CONFIG_MACRO_DIR([m4]) + +GB_INIT(gb.sdl2) +AC_PROG_LIBTOOL + +GB_COMPONENT_SEARCH( + sdl2, SDL2, gb.sdl2, [src], + sdl2 ">= 2.0.2" SDL2_ttf ">= 2.0.12" +) + +AC_OUTPUT( \ +Makefile \ +src/Makefile \ +) + +GB_PRINT_MESSAGES diff --git a/gb.sdl2/depcomp b/gb.sdl2/depcomp new file mode 120000 index 000000000..7ef7de62b --- /dev/null +++ b/gb.sdl2/depcomp @@ -0,0 +1 @@ +../depcomp \ No newline at end of file diff --git a/gb.sdl2/gambas.h b/gb.sdl2/gambas.h new file mode 120000 index 000000000..03677ecd0 --- /dev/null +++ b/gb.sdl2/gambas.h @@ -0,0 +1 @@ +../main/share/gambas.h \ No newline at end of file diff --git a/gb.sdl2/gb.image.h b/gb.sdl2/gb.image.h new file mode 120000 index 000000000..c8c09bcc9 --- /dev/null +++ b/gb.sdl2/gb.image.h @@ -0,0 +1 @@ +../main/lib/image/gb.image.h \ No newline at end of file diff --git a/gb.sdl2/gb_common.h b/gb.sdl2/gb_common.h new file mode 120000 index 000000000..707d79da6 --- /dev/null +++ b/gb.sdl2/gb_common.h @@ -0,0 +1 @@ +../main/share/gb_common.h \ No newline at end of file diff --git a/gb.sdl2/gb_list.h b/gb.sdl2/gb_list.h new file mode 120000 index 000000000..cfd354892 --- /dev/null +++ b/gb.sdl2/gb_list.h @@ -0,0 +1 @@ +../main/share/gb_list.h \ No newline at end of file diff --git a/gb.sdl2/gb_list_temp.h b/gb.sdl2/gb_list_temp.h new file mode 120000 index 000000000..0bd26c393 --- /dev/null +++ b/gb.sdl2/gb_list_temp.h @@ -0,0 +1 @@ +../main/share/gb_list_temp.h \ No newline at end of file diff --git a/gb.sdl2/m4 b/gb.sdl2/m4 new file mode 120000 index 000000000..7d49a2a4b --- /dev/null +++ b/gb.sdl2/m4 @@ -0,0 +1 @@ +../m4 \ No newline at end of file diff --git a/gb.sdl2/missing b/gb.sdl2/missing new file mode 120000 index 000000000..f3ade9ba1 --- /dev/null +++ b/gb.sdl2/missing @@ -0,0 +1 @@ +../missing \ No newline at end of file diff --git a/gb.sdl2/reconf b/gb.sdl2/reconf new file mode 120000 index 000000000..48a376da6 --- /dev/null +++ b/gb.sdl2/reconf @@ -0,0 +1 @@ +../reconf \ No newline at end of file diff --git a/gb.sdl2/src/Makefile.am b/gb.sdl2/src/Makefile.am new file mode 100644 index 000000000..c361be954 --- /dev/null +++ b/gb.sdl2/src/Makefile.am @@ -0,0 +1,13 @@ +COMPONENT = gb.sdl2 +include $(top_srcdir)/component.am + +gblib_LTLIBRARIES = gb.sdl2.la + +gb_sdl2_la_LIBADD = @SDL2_LIB@ +gb_sdl2_la_LDFLAGS = -module @LD_FLAGS@ @SDL2_LDFLAGS@ +gb_sdl2_la_CXXFLAGS = $(AM_CXXFLAGS) -DDATA_DIR=\"$(DESTDIR)$(gbdatadir)/$(COMPONENT)\" +gb_sdl2_la_CPPFLAGS = @SDL2_INC@ + +gb_sdl2_la_SOURCES = \ + c_window.h c_window.c \ + main.h main.c diff --git a/gb.sdl2/src/c_window.c b/gb.sdl2/src/c_window.c new file mode 100644 index 000000000..bcbf2be9d --- /dev/null +++ b/gb.sdl2/src/c_window.c @@ -0,0 +1,275 @@ +/*************************************************************************** + + c_window.c + + (c) 2014 Benoît Minisini + + 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#define __C_WINDOW_C + +#include "c_window.h" + +#define THIS ((CWINDOW *)_object) +#define WINDOW THIS->window + +DECLARE_EVENT(EVENT_Open); +DECLARE_EVENT(EVENT_Close); +DECLARE_EVENT(EVENT_Show); +DECLARE_EVENT(EVENT_Hide); +DECLARE_EVENT(EVENT_Move); +DECLARE_EVENT(EVENT_Resize); +DECLARE_EVENT(EVENT_Enter); +DECLARE_EVENT(EVENT_Leave); +DECLARE_EVENT(EVENT_GotFocus); +DECLARE_EVENT(EVENT_LostFocus); + +CWINDOW *WINDOW_list = NULL; + +static void close_window(void *_object) +{ + if (!THIS->opened) + return; + + if (GB.Raise(THIS, EVENT_Close, 0)) + return; + + LIST_remove(&WINDOW_list, THIS, &THIS->list); + SDL_HideWindow(WINDOW); + THIS->opened = FALSE; + GB.Unref(POINTER(&_object)); +} + +void WINDOW_handle_event(SDL_WindowEvent *event) +{ + SDL_Window *window; + CWINDOW *_object; + + window = SDL_GetWindowFromID(event->windowID); + _object = SDL_GetWindowData(window, "gambas-object"); + if (!THIS) + return; + + switch(event->event) + { + case SDL_WINDOWEVENT_SHOWN: + GB.Raise(THIS, EVENT_Show, 0); + break; + case SDL_WINDOWEVENT_HIDDEN: + GB.Raise(THIS, EVENT_Hide, 0); + break; + /*case SDL_WINDOWEVENT_EXPOSED:*/ + case SDL_WINDOWEVENT_MOVED: + GB.Raise(THIS, EVENT_Move, 0); + break; + case SDL_WINDOWEVENT_RESIZED: + GB.Raise(THIS, EVENT_Resize, 0); + break; + /*case SDL_WINDOWEVENT_MINIMIZED: + SDL_Log("Window %d minimized", event->window.windowID); + break; + case SDL_WINDOWEVENT_MAXIMIZED: + SDL_Log("Window %d maximized", event->window.windowID); + break; + case SDL_WINDOWEVENT_RESTORED: + SDL_Log("Window %d restored", event->window.windowID); + break;*/ + case SDL_WINDOWEVENT_ENTER: + GB.Raise(THIS, EVENT_Enter, 0); + break; + case SDL_WINDOWEVENT_LEAVE: + GB.Raise(THIS, EVENT_Leave, 0); + break; + case SDL_WINDOWEVENT_FOCUS_GAINED: + GB.Raise(THIS, EVENT_GotFocus, 0); + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + GB.Raise(THIS, EVENT_LostFocus, 0); + break; + case SDL_WINDOWEVENT_CLOSE: + close_window(THIS); + break; + } +} + +//------------------------------------------------------------------------- + +BEGIN_METHOD(Window_new, GB_BOOLEAN opengl) + + THIS->opengl = VARGOPT(opengl, FALSE); + + if (SDL_CreateWindowAndRenderer(0, 0, SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_HIDDEN, &THIS->window, &THIS->renderer)) + { + RAISE_ERROR("Unable to create window"); + return; + } + + SDL_SetWindowData(THIS->window, "gambas-object", THIS); + +END_METHOD + +BEGIN_METHOD_VOID(Window_free) + + SDL_DestroyRenderer(THIS->renderer); + SDL_DestroyWindow(WINDOW); + +END_METHOD + +BEGIN_METHOD_VOID(Window_Show) + + if (!THIS->opened) + { + if (GB.Raise(THIS, EVENT_Open, 0)) + return; + THIS->opened = TRUE; + GB.Ref(THIS); + LIST_insert(&WINDOW_list, THIS, &THIS->list); + } + + SDL_ShowWindow(WINDOW); + +END_METHOD + +BEGIN_METHOD_VOID(Window_Hide) + + SDL_HideWindow(WINDOW); + +END_METHOD + +BEGIN_METHOD_VOID(Window_Close) + + close_window(THIS); + +END_METHOD + +BEGIN_PROPERTY(Window_Visible) + + if (READ_PROPERTY) + GB.ReturnBoolean(SDL_GetWindowFlags(WINDOW) & SDL_WINDOW_SHOWN); + else + { + if (VPROP(GB_BOOLEAN)) + SDL_ShowWindow(WINDOW); + else + SDL_HideWindow(WINDOW); + } + +END_PROPERTY + +void set_geometry(void *_object, int x, int y, int w, int h) +{ + if (x > 0 && y > 0) + SDL_SetWindowPosition(WINDOW, x, y); + + if (w >= 0 && h >= 0) + { + SDL_SetWindowFullscreen(WINDOW, (w > 0 && h > 0) ? 0 : SDL_WINDOW_FULLSCREEN_DESKTOP); + SDL_SetWindowSize(WINDOW, w, h); + } +} + +BEGIN_METHOD(Window_Move, GB_INTEGER x; GB_INTEGER y; GB_INTEGER width; GB_INTEGER height) + + set_geometry(THIS, VARG(x), VARG(y), VARGOPT(width, -1), VARGOPT(height, -1)); + +END_METHOD + +BEGIN_METHOD(Window_Resize, GB_INTEGER width; GB_INTEGER height) + + set_geometry(THIS, -1, -1, VARG(width), VARG(height)); + +END_METHOD + +//------------------------------------------------------------------------- + +GB_DESC WindowDesc[] = +{ + GB_DECLARE("Window", sizeof(CWINDOW)), + + GB_METHOD("_new", NULL, Window_new, "[(OpenGL)b]"), + GB_METHOD("_free", NULL, Window_free, NULL), + + GB_METHOD("Show", NULL, Window_Show, NULL), + GB_METHOD("Hide", NULL, Window_Hide, NULL), + GB_METHOD("Close", NULL, Window_Close, NULL), + GB_METHOD("Move", NULL, Window_Move, "(X)i(Y)i[(Width)i(Height)i]"), + GB_METHOD("Resize", NULL, Window_Resize, "(Width)i(Height)i"), + + GB_PROPERTY("Visible", "b", Window_Visible), + + GB_EVENT("Open", NULL, NULL, &EVENT_Open), + GB_EVENT("Close", NULL, NULL, &EVENT_Close), + GB_EVENT("Show", NULL, NULL, &EVENT_Show), + GB_EVENT("Hide", NULL, NULL, &EVENT_Hide), + GB_EVENT("Move", NULL, NULL, &EVENT_Move), + GB_EVENT("Resize", NULL, NULL, &EVENT_Resize), + GB_EVENT("Enter", NULL, NULL, &EVENT_Enter), + GB_EVENT("Leave", NULL, NULL, &EVENT_Leave), + GB_EVENT("GotFocus", NULL, NULL, &EVENT_GotFocus), + GB_EVENT("LostFocus", NULL, NULL, &EVENT_LostFocus), + +/* GB_METHOD("_new", NULL, CWINDOW_new, "[(OpenGL)b]"), + GB_METHOD("_free", NULL, CWINDOW_free, NULL), + + GB_METHOD("Show", NULL, CWINDOW_show, NULL), + GB_METHOD("Close", NULL, CWINDOW_close, NULL), + GB_METHOD("Clear", NULL, CWINDOW_clear, NULL), + GB_METHOD("Fill", NULL, CWINDOW_fill, "(Color)i"), + GB_METHOD("Refresh", NULL, CWINDOW_refresh, NULL), + GB_METHOD("Update", NULL, CWINDOW_refresh, NULL), + + GB_PROPERTY("Caption", "s", CWINDOW_text), +// GB_PROPERTY("Cursor", "Cursor;", CWINDOW_cursor), + GB_PROPERTY("Framerate", "f", CWINDOW_framerate), + GB_PROPERTY("FullScreen", "b", CWINDOW_fullscreen), + GB_PROPERTY("Height", "i", CWINDOW_height), + GB_PROPERTY("Mouse", "i", CWINDOW_mouse), + GB_PROPERTY("Text", "s", CWINDOW_text), + GB_PROPERTY("Title", "s", CWINDOW_text), + GB_PROPERTY("Tracking", "b", CWINDOW_tracking), + GB_PROPERTY("Resizable", "b", CWINDOW_resizable), + GB_PROPERTY("Width", "i", CWINDOW_width), + + GB_PROPERTY_READ("Handle", "i", CWINDOW_id), + GB_PROPERTY_READ("Id", "i", CWINDOW_id), + GB_PROPERTY_READ("Shown", "b", CWINDOW_shown), + GB_PROPERTY("Grabbed", "b", Window_Grabbed), + + GB_METHOD("Screenshot", "Image", Window_Screenshot, "[(X)i(Y)i(Width)i(Height)i]"), + + GB_EVENT("Close", "b", NULL, &EVENT_Close), + GB_EVENT("Resize", NULL, NULL, &EVENT_Resize), + GB_EVENT("Activate", NULL, NULL, &EVENT_Activate), + GB_EVENT("Deactivate", NULL, NULL, &EVENT_Deactivate), + GB_EVENT("Enter", NULL, NULL, &EVENT_Enter), + GB_EVENT("JoyAxisMove", NULL, NULL, &EVENT_JoyAxisMotion), + GB_EVENT("JoyBallMove", NULL, NULL, &EVENT_JoyBallMotion), + GB_EVENT("JoyButtonPress", NULL, NULL, &EVENT_JoyButtonPressed), + GB_EVENT("JoyButtonRelease", NULL, NULL, &EVENT_JoyButtonReleased), + GB_EVENT("JoyHatMove", NULL, NULL, &EVENT_JoyHatMotion), + GB_EVENT("Leave", NULL, NULL, &EVENT_Leave), + GB_EVENT("Draw", "b", NULL, &EVENT_Refresh), + GB_EVENT("KeyPress", NULL, NULL, &EVENT_KeyPressed), + GB_EVENT("KeyRelease", NULL, NULL, &EVENT_KeyReleased), + GB_EVENT("MouseMove", NULL, NULL, &EVENT_MouseMove), + GB_EVENT("MouseDown", NULL, NULL, &EVENT_MouseDown), + GB_EVENT("MouseUp", NULL, NULL, &EVENT_MouseUp), + GB_EVENT("Open", NULL, NULL, &EVENT_Open),*/ + + GB_END_DECLARE +}; diff --git a/gb.sdl2/src/c_window.h b/gb.sdl2/src/c_window.h new file mode 100644 index 000000000..d1b949ca2 --- /dev/null +++ b/gb.sdl2/src/c_window.h @@ -0,0 +1,51 @@ +/*************************************************************************** + + c_window.h + + (c) 2014 Benoît Minisini + + 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#ifndef __C_WINDOW_H +#define __C_WINDOW_H + +#include "main.h" + +typedef + struct CWINDOW { + GB_BASE ob; + LIST list; + SDL_Window *window; + SDL_Renderer *renderer; + bool opengl; + bool opened; + } + CWINDOW; + +#ifndef __C_WINDOW_C + +extern GB_DESC WindowDesc[]; + +extern CWINDOW *WINDOW_list; + +void WINDOW_handle_event(SDL_WindowEvent *event); + +#endif + +#endif /* __C_WINDOW_H */ + diff --git a/gb.sdl2/src/gb.sdl2.component b/gb.sdl2/src/gb.sdl2.component new file mode 100644 index 000000000..dff18be1e --- /dev/null +++ b/gb.sdl2/src/gb.sdl2.component @@ -0,0 +1,5 @@ +[Component] +Key=gb.sdl2 +Implements=EventLoop,OpenGLViewer +Requires=gb.image,gb.image.io +State=1 diff --git a/gb.sdl2/src/main.c b/gb.sdl2/src/main.c new file mode 100644 index 000000000..f2aaf9786 --- /dev/null +++ b/gb.sdl2/src/main.c @@ -0,0 +1,124 @@ +/*************************************************************************** + + main.c + + (c) 2014 Benoît Minisini + + 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#define __MAIN_C + +#include "gambas.h" +#include "main.h" +#include "c_window.h" + +#include "gb_list_temp.h" + +GB_INTERFACE GB EXPORT; +IMAGE_INTERFACE IMAGE EXPORT; + +static void event_loop() +{ + SDL_Event event; + + while (SDL_PollEvent(&event)) + { + switch(event.type) + { + case SDL_QUIT: + break; + case SDL_WINDOWEVENT: + WINDOW_handle_event(&event.window); + break; + } + } +} + +static void my_main(int *argc, char **argv) +{ +} + +static int my_loop() +{ + while (WINDOW_list != NULL) + event_loop(); + + return 1; +} + +static void my_wait(int duration) +{ + event_loop(); +} + +GB_DESC *GB_CLASSES[] EXPORT = +{ + WindowDesc, + NULL +}; + +int EXPORT GB_INIT(void) +{ + GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE); + IMAGE.SetDefaultFormat(GB_IMAGE_BGRA); + + GB.Hook(GB_HOOK_MAIN, (void *)my_main); + GB.Hook(GB_HOOK_LOOP, (void *)my_loop); + GB.Hook(GB_HOOK_WAIT, (void *)my_wait); + + /*CLASS_Window = GB.FindClass("Window"); + CLASS_Image = GB.FindClass("Image"); + CLASS_Font = GB.FindClass("Font");*/ + + if (SDL_Init(SDL_INIT_EVERYTHING)) + { + fprintf(stderr, "gb.sdl2: error: unable to initialize the library: %s\n", SDL_GetError()); + abort(); + } + + return -1; +} + +void EXPORT GB_EXIT() +{ + SDL_Quit(); +} + +void EXPORT GB_SIGNAL(int signal, void *param) +{ + //static bool wasFullscreen = false; + + //if (!SDLcore::GetWindow()) + // return; + + if ((signal == GB_SIGNAL_DEBUG_BREAK) || (signal == GB_SIGNAL_DEBUG_CONTINUE)) + { + /*if (SDLcore::GetWindow()->IsFullScreen()) + { + wasFullscreen = true; + SDLcore::GetWindow()->SetFullScreen(false); + }*/ + } + + if (signal == GB_SIGNAL_DEBUG_CONTINUE) + { + /*if (wasFullscreen) + SDLcore::GetWindow()->SetFullScreen(true);*/ + } +} + diff --git a/gb.sdl2/src/main.h b/gb.sdl2/src/main.h new file mode 100644 index 000000000..f6022e57f --- /dev/null +++ b/gb.sdl2/src/main.h @@ -0,0 +1,42 @@ +/*************************************************************************** + + main.h + + (c) 2014 Benoît Minisini + + 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., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +***************************************************************************/ + +#ifndef __MAIN_H +#define __MAIN_H + +#include "gambas.h" +#include "gb_common.h" +#include "gb_list.h" +#include "gb.image.h" + +#include "SDL.h" + +#ifndef __MAIN_C +extern GB_INTERFACE GB; +extern IMAGE_INTERFACE IMAGE; +#endif + +#define RAISE_ERROR(_msg) GB.Error(_msg ": &1", SDL_GetError()); + +#endif /* __MAIN_H */ +