2012-05-06 23:09:42 +02:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
main.c
|
|
|
|
|
2022-09-12 15:13:13 +02:00
|
|
|
(c) 2000-2017 Benoît Minisini <benoit.minisini@gambas-basic.org>
|
2012-05-06 23:09:42 +02:00
|
|
|
|
|
|
|
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 "main.h"
|
|
|
|
|
|
|
|
GB_INTERFACE GB EXPORT;
|
|
|
|
|
|
|
|
GB_DESC *GB_CLASSES[] EXPORT =
|
|
|
|
{
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2021-05-07 19:20:04 +02:00
|
|
|
char *GB_INCLUDE EXPORT = "gb.qt4.opengl|gb.qt5.opengl|gb.gtk.opengl|gb.gtk3.opengl";
|
2012-05-06 23:09:42 +02:00
|
|
|
|
|
|
|
int EXPORT GB_INIT(void)
|
|
|
|
{
|
|
|
|
const char *comp = NULL;
|
|
|
|
char *env;
|
|
|
|
|
|
|
|
env = getenv("GB_GUI");
|
|
|
|
if (env)
|
|
|
|
{
|
2015-05-11 03:46:36 +02:00
|
|
|
if (strcmp(env, "gb.qt4") == 0)
|
2012-05-06 23:09:42 +02:00
|
|
|
comp = "gb.qt4.opengl";
|
2015-05-11 03:46:36 +02:00
|
|
|
else if (strcmp(env, "gb.qt5") == 0)
|
|
|
|
comp = "gb.qt5.opengl";
|
|
|
|
else if (strcmp(env, "gb.gtk") == 0)
|
2012-05-06 23:09:42 +02:00
|
|
|
comp = "gb.gtk.opengl";
|
2021-05-07 19:20:04 +02:00
|
|
|
else if (strcmp(env, "gb.gtk3") == 0)
|
|
|
|
comp = "gb.gtk3.opengl";
|
2012-05-06 23:09:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!comp)
|
|
|
|
{
|
2013-11-01 14:18:47 +01:00
|
|
|
// GB_GUI should be set by gb.gui
|
2015-05-11 03:46:36 +02:00
|
|
|
if (!env)
|
2020-09-23 01:06:18 +02:00
|
|
|
fprintf(stderr, "gb.gui.opengl: error: no component specified in GB_GUI environment variable\n");
|
2015-05-11 03:46:36 +02:00
|
|
|
else
|
2020-09-23 01:06:18 +02:00
|
|
|
fprintf(stderr, "gb.gui.opengl: error: unsupported component specified in GB_GUI environment variable\n");
|
2013-11-01 14:18:47 +01:00
|
|
|
exit(1);
|
2012-05-06 23:09:42 +02:00
|
|
|
}
|
|
|
|
|
2012-05-08 17:32:33 +02:00
|
|
|
if (GB.Component.Load(comp))
|
2012-05-06 23:09:42 +02:00
|
|
|
fprintf(stderr, "gb.gui.opengl: unable to load '%s' component\n", comp);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EXPORT GB_EXIT()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|