mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-08 07:55:14 +00:00
Tidy up some #defines, remove a few Android #ifdefs
This commit is contained in:
parent
8917bf0e52
commit
adeda29619
|
@ -1,3 +1,4 @@
|
||||||
|
//Fill out dependency macros
|
||||||
#ifndef DEPENDENCY_NO_SOCKETS
|
#ifndef DEPENDENCY_NO_SOCKETS
|
||||||
#define DEPENDENCY_SOCKETS
|
#define DEPENDENCY_SOCKETS
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,22 +19,13 @@
|
||||||
#define INC_COMMON_CPP
|
#define INC_COMMON_CPP
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
#ifdef QB64_ANDROID
|
#define QB64_GL1
|
||||||
#define QB64_GLES
|
#define QB64_GLUT
|
||||||
#define QB64_GLES1
|
|
||||||
#define QB64_NOT_X86
|
|
||||||
#define QB64_GLUT
|
|
||||||
#else
|
|
||||||
#define QB64_GL1
|
|
||||||
#define QB64_GLUT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef QB64_LINUX
|
#ifdef QB64_LINUX
|
||||||
#ifndef QB64_MACOSX
|
#ifndef QB64_MACOSX
|
||||||
#ifndef QB64_ANDROID
|
#define QB64_X11
|
||||||
#define QB64_X11
|
#endif
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEPENDENCY_CONSOLE_ONLY
|
#ifdef DEPENDENCY_CONSOLE_ONLY
|
||||||
|
@ -44,26 +36,12 @@
|
||||||
|
|
||||||
#define NO_S_D_L
|
#define NO_S_D_L
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
|
||||||
#include "parts\\core\\gl_headers\\glew\\glew.h"
|
|
||||||
#else
|
|
||||||
#include "parts/core/gl_headers/glew/glew.h"
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//core
|
//core
|
||||||
#ifdef QB64_GUI
|
#ifdef QB64_GUI
|
||||||
#ifdef QB64_GLUT
|
#ifdef QB64_GLUT
|
||||||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
|
||||||
#include "parts\\core\\src.c"
|
|
||||||
#else
|
|
||||||
#include "parts/core/src.c"
|
#include "parts/core/src.c"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef QB64_WINDOWS
|
#ifdef QB64_WINDOWS
|
||||||
|
|
||||||
|
@ -126,15 +104,9 @@
|
||||||
|
|
||||||
#ifdef QB64_GUI
|
#ifdef QB64_GUI
|
||||||
#ifdef QB64_GLUT
|
#ifdef QB64_GLUT
|
||||||
#ifndef QB64_ANDROID
|
|
||||||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
|
||||||
#include "parts\\core\\gl_headers\\opengl_org_registery\\glext.h"
|
|
||||||
#else
|
|
||||||
#include "parts/core/gl_headers/opengl_org_registery/glext.h"
|
#include "parts/core/gl_headers/opengl_org_registery/glext.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
@ -2,44 +2,7 @@
|
||||||
#include "libqb.h"
|
#include "libqb.h"
|
||||||
|
|
||||||
#ifdef QB64_GUI
|
#ifdef QB64_GUI
|
||||||
#ifndef QB64_GLES
|
#include "parts/core/glew/src/glew.c"
|
||||||
#include "parts/core/glew/src/glew.c"
|
|
||||||
#else
|
|
||||||
//GLEW does not appear to support GLES, so "wrangle" the required functionality here
|
|
||||||
#define glGenFramebuffers glGenFramebuffersOES
|
|
||||||
#define glGenFramebuffersEXT glGenFramebuffersOES
|
|
||||||
#define glDeleteFramebuffers glDeleteFramebuffersOES
|
|
||||||
#define glDeleteFramebuffersEXT glDeleteFramebuffersOES
|
|
||||||
#define glBindFramebuffer glBindFramebufferOES
|
|
||||||
#define glBindFramebufferEXT glBindFramebufferOES
|
|
||||||
#define glFramebufferTexture2D glFramebufferTexture2DOES
|
|
||||||
#define glFramebufferTexture2DEXT glFramebufferTexture2DOES
|
|
||||||
#define glFramebufferRenderbuffer glFramebufferRenderbufferOES
|
|
||||||
#define glCheckFramebufferStatus glCheckFramebufferStatusOES
|
|
||||||
#define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
|
|
||||||
#define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
|
|
||||||
#define glGenRenderbuffers glGenRenderbuffersOES
|
|
||||||
#define glDeleteRenderbuffers glDeleteRenderbuffersOES
|
|
||||||
#define glBindRenderbuffer glBindRenderbufferOES
|
|
||||||
#define glRenderbufferTexture2D glRenderbufferTexture2DOES
|
|
||||||
#define glRenderbufferTexture2DEXT glRenderbufferTexture2DOES
|
|
||||||
#define glRenderbufferRenderbuffer glRenderbufferRenderbufferOES
|
|
||||||
#define glGetRenderbufferParameteriv glGetRenderbufferParameterivOES
|
|
||||||
#define glRenderbufferStorage glRenderbufferStorageOES
|
|
||||||
#define GL_RENDERBUFFER GL_RENDERBUFFER_OES
|
|
||||||
#define GL_RENDERBUFFER_WIDTH GL_RENDERBUFFER_WIDTH_OES
|
|
||||||
#define GL_RENDERBUFFER_HEIGHT GL_RENDERBUFFER_HEIGHT_OES
|
|
||||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT GL_RENDERBUFFER_INTERNAL_FORMAT_OES
|
|
||||||
#define GL_MAX_RENDERBUFFER_SIZE GL_MAX_RENDERBUFFER_SIZE_OES
|
|
||||||
#define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
|
|
||||||
#define GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
|
|
||||||
#define GL_DEPTH_COMPONENT16 GL_DEPTH_COMPONENT16_OES
|
|
||||||
#define glOrtho glOrthof
|
|
||||||
//...
|
|
||||||
|
|
||||||
#define GL_BGRA GL_RGBA //this is to prevent errors and ensure RGBA is used even when BGRA is supported
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -31251,28 +31214,11 @@ QB64_GAMEPAD_INIT();
|
||||||
}
|
}
|
||||||
window_exists=1;
|
window_exists=1;
|
||||||
|
|
||||||
|
|
||||||
//alert("hello");
|
|
||||||
|
|
||||||
|
|
||||||
//no segfault here
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef QB64_GLES
|
|
||||||
framebufferobjects_supported=1;
|
|
||||||
#else
|
|
||||||
GLenum err = glewInit();
|
GLenum err = glewInit();
|
||||||
if (GLEW_OK != err)
|
if (GLEW_OK != err) {
|
||||||
{
|
alert( (char*)glewGetErrorString(err));
|
||||||
alert( (char*)glewGetErrorString(err));
|
}
|
||||||
}
|
|
||||||
//alert( (char*)glewGetString(GLEW_VERSION));
|
|
||||||
|
|
||||||
if (glewIsSupported("GL_EXT_framebuffer_object")) framebufferobjects_supported=1;
|
if (glewIsSupported("GL_EXT_framebuffer_object")) framebufferobjects_supported=1;
|
||||||
#endif
|
|
||||||
|
|
||||||
//no segfault here
|
|
||||||
|
|
||||||
|
|
||||||
glutDisplayFunc(GLUT_DISPLAY_REQUEST);
|
glutDisplayFunc(GLUT_DISPLAY_REQUEST);
|
||||||
|
|
||||||
|
@ -31831,9 +31777,6 @@ QB64_GAMEPAD_INIT();
|
||||||
|
|
||||||
static uint8 BGRA_to_RGBA;//set to 1 to invert the output to RGBA
|
static uint8 BGRA_to_RGBA;//set to 1 to invert the output to RGBA
|
||||||
BGRA_to_RGBA=0;//default is 0 but 1 is fun
|
BGRA_to_RGBA=0;//default is 0 but 1 is fun
|
||||||
#ifdef QB64_GLES1 //OPENGL ES does not support GL_BGRA
|
|
||||||
BGRA_to_RGBA=1;
|
|
||||||
#endif
|
|
||||||
if (cloud_app){ //more converters handle the RGBA data format than BGRA which is dumped
|
if (cloud_app){ //more converters handle the RGBA data format than BGRA which is dumped
|
||||||
BGRA_to_RGBA=1;
|
BGRA_to_RGBA=1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,19 @@
|
||||||
//OS/compiler detection
|
/* Provide some OS/compiler macros. Note that a Mac has QB64_LINUX too
|
||||||
|
* QB64_WINDOWS: Is this a Windows system?
|
||||||
|
* QB64_BACKSLASH_FILESYSTEM: Does this system use \ for file paths (as opposed to /)?
|
||||||
|
* QB64_MICROSOFT: Are we compiling with Visual Studio?
|
||||||
|
* QB64_GCC: Are we compiling with gcc?
|
||||||
|
* QB64_MINGW: Are we compiling with MinGW, specifically? (Set in addition to QB64_GCC)
|
||||||
|
* QB64_LINUX: Is this a Unix system? (really should be QB64_UNIX)
|
||||||
|
* QB64_MACOSX: Is this MacOSX, or MacOS or whatever Apple calls it now?
|
||||||
|
* QB64_32: A 32bit system (the default)
|
||||||
|
* QB64_64: A 64bit system (assumes all Macs are 64 bit)
|
||||||
|
*/
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define QB64_WINDOWS
|
#define QB64_WINDOWS
|
||||||
#define QB64_BACKSLASH_FILESYSTEM
|
#define QB64_BACKSLASH_FILESYSTEM
|
||||||
#define NO_STDIO_REDIRECT
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
//Do we even support non-mingw compilers on Windows?
|
||||||
#define QB64_MICROSOFT
|
#define QB64_MICROSOFT
|
||||||
#else
|
#else
|
||||||
#define QB64_GCC
|
#define QB64_GCC
|
||||||
|
@ -15,12 +25,19 @@
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define QB64_MACOSX
|
#define QB64_MACOSX
|
||||||
#endif
|
#endif
|
||||||
#ifdef __ANDROID__
|
|
||||||
#define QB64_ANDROID
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//common types
|
#if _WIN64 || __x86_64__ || __ppc64__ || QB64_MACOSX
|
||||||
|
#define QB64_64
|
||||||
|
#else
|
||||||
|
#define QB64_32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* common types (not quite an include guard, but allows an including
|
||||||
|
* file to not have these included.
|
||||||
|
*
|
||||||
|
* Should this be adapted to check for each type before defining?
|
||||||
|
*/
|
||||||
#ifndef QB64_OS_H_NO_TYPES
|
#ifndef QB64_OS_H_NO_TYPES
|
||||||
#ifdef QB64_WINDOWS
|
#ifdef QB64_WINDOWS
|
||||||
#define uint64 unsigned __int64
|
#define uint64 unsigned __int64
|
||||||
|
@ -41,26 +58,7 @@
|
||||||
#define uint16 uint16_t
|
#define uint16 uint16_t
|
||||||
#define uint8 uint8_t
|
#define uint8 uint8_t
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check windows
|
|
||||||
#if _WIN32 || _WIN64
|
|
||||||
#if _WIN64
|
|
||||||
#define QB64_64
|
|
||||||
#else
|
|
||||||
#define QB64_32
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
// Check GCC
|
|
||||||
#if __GNUC__
|
|
||||||
#if __x86_64__ || __ppc64__
|
|
||||||
#define QB64_64
|
|
||||||
#else
|
|
||||||
#define QB64_32
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef QB64_OS_H_NO_TYPES
|
|
||||||
#ifdef QB64_64
|
#ifdef QB64_64
|
||||||
#define ptrszint int64
|
#define ptrszint int64
|
||||||
#define uptrszint uint64
|
#define uptrszint uint64
|
||||||
|
@ -70,4 +68,4 @@
|
||||||
#define uptrszint uint32
|
#define uptrszint uint32
|
||||||
#define ptrsz 4
|
#define ptrsz 4
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,11 +4,6 @@
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QB64_ANDROID
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cmath>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* testing only
|
/* testing only
|
||||||
#ifdef QB64_WINDOWS
|
#ifdef QB64_WINDOWS
|
||||||
|
|
||||||
|
@ -44,11 +39,7 @@ extern int32 sub_gl_called;
|
||||||
#ifdef QB64_GUI
|
#ifdef QB64_GUI
|
||||||
#ifdef DEPENDENCY_GL
|
#ifdef DEPENDENCY_GL
|
||||||
|
|
||||||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
#include "parts/core/gl_header_for_parsing/temp/gl_helper_code.h"
|
||||||
#include "parts\\core\\gl_header_for_parsing\\temp\\gl_helper_code.h"
|
|
||||||
#else
|
|
||||||
#include "parts/core/gl_header_for_parsing/temp/gl_helper_code.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
double pi_as_double=3.14159265358979;
|
double pi_as_double=3.14159265358979;
|
||||||
void gluPerspective(double fovy, double aspect, double zNear, double zFar)
|
void gluPerspective(double fovy, double aspect, double zNear, double zFar)
|
||||||
|
@ -58,55 +49,13 @@ extern int32 sub_gl_called;
|
||||||
ymin = -ymax;
|
ymin = -ymax;
|
||||||
xmin = ymin * aspect;
|
xmin = ymin * aspect;
|
||||||
xmax = ymax * aspect;
|
xmax = ymax * aspect;
|
||||||
#ifdef QB64_GLES1
|
|
||||||
glFrustumf(xmin, xmax, ymin, ymax, zNear, zFar);
|
|
||||||
#else
|
|
||||||
glFrustum(xmin, xmax, ymin, ymax, zNear, zFar);
|
glFrustum(xmin, xmax, ymin, ymax, zNear, zFar);
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
|
||||||
#include "parts\\audio\\conversion\\conversion.c"
|
|
||||||
#else
|
|
||||||
#include "parts/audio/conversion/conversion.c"
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
//http://kcat.strangesoft.net/openal-tutorial.html
|
|
||||||
///OPENAL
|
|
||||||
#include "AL/al.h"
|
|
||||||
#include "AL/alc.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
ALCdevice *dev;
|
|
||||||
ALCcontext *ctx;
|
|
||||||
struct stat statbuf;
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
extern int32 allocated_bytes;
|
|
||||||
extern void *calloc2(int x, int y);
|
|
||||||
extern void *realloc2(void *x, int y);
|
|
||||||
extern void *malloc2(int x);
|
|
||||||
#define malloc(x) malloc2(x)
|
|
||||||
#define calloc(x,y) calloc2(x,y)
|
|
||||||
#define realloc(x,y) realloc2(x,y)
|
|
||||||
*/
|
|
||||||
|
|
||||||
//forward references
|
//forward references
|
||||||
void QBMAIN(void *);
|
void QBMAIN(void *);
|
||||||
|
|
Loading…
Reference in a new issue