else # WINDOWS_TARGET
+ifdef OSX_TARGET
+# TODO: OSX soname
+SOV := $(SO)
+else
SOV := $(SO)$(LIBVER)
+endif
ifndef DESTDIR
export DESTDIR=
else
ifeq "$(HOSTTYPE)" "x86_64"
+ifdef OSX_HOST
+export PREFIXLIBDIR=$(prefix)/lib
+else
export PREFIXLIBDIR=$(prefix)/lib32
+endif
else
export PREFIXLIBDIR=$(prefix)/lib
endif
_CPP = $(if $(findstring $(space),$(CPP)),"$(CPP)",$(CPP))
+_SYSROOT = $(if $(SYSROOT),$(space)--sysroot=$(SYSROOT),)
+
# SHELL COMMANDS
ifdef WINDOWS_HOST
ifndef MSYSCON
# TOOLCHAIN
export CC = $(CCACHE_COMPILE)$(DISTCC_COMPILE)$(GCC_PREFIX)gcc$(_SYSROOT)
-export CPP = $(CCACHE_COMPILE)$(DISTCC_COMPILE)$(GCC_PREFIX)cpp$(_SYSROOT)
+export CPP = $(CCACHE_COMPILE)$(DISTCC_COMPILE)$(GCC_PREFIX)gcc$(_SYSROOT)
export AS = $(GCC_PREFIX)as
export LD = $(GCC_PREFIX)ld
export AR = $(GCC_PREFIX)ar
LDFLAGS += -L/usr/local/lib
endif
+ifdef OSX_TARGET
+CFLAGS += -I$(SYSROOT)/usr/include/ffi
+endif
+
OFLAGS += $(LDFLAGS)
# FLAGS
all: freetype jpeg png gif ffi z
else
ifdef OSX_TARGET
-all: jpeg png gif
+all: jpeg gif
else
all: gif
endif
LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
PRJ_CFLAGS += \
- $(if $(DEBUG), -g, -O2 -ffast-math) $(FPIC) -w
+ $(if $(DEBUG), -g, -O2 -ffast-math) $(FPIC) -w $(FORCE_32_BIT)
-I../deps/libungif-4.1.1/lib,) \
$(if $(OSX_TARGET), \
-I/usr/include/freetype2 \
+ -I$(SYSROOT)/usr/X11/include/freetype2 \
+ -I$(SYSROOT)/usr/X11/include \
-I/usr/X11R6/include/freetype2 \
-I/usr/X11R6/include \
-I../deps/jpeg-6b \
-I../deps/libungif-4.1.1/lib,) \
$(if $(OSX_TARGET), \
-I/usr/include/freetype2 \
+ -I$(SYSROOT)/usr/X11/include/freetype2 \
+ -I$(SYSROOT)/usr/X11/include \
-I/usr/X11R6/include/freetype2 \
-I/usr/X11R6/include \
-I../deps/jpeg-6b \
"Options" : {
"IncludeDirs" : [
"/usr/include/freetype2",
+ "$(SYSROOT)/usr/X11/include/freetype2",
+ "$(SYSROOT)/usr/X11/include",
"/usr/X11R6/include/freetype2",
"/usr/X11R6/include",
"../deps/jpeg-6b",
"GL"
],
"LibraryDirs" : [
+ "$(SYSROOT)/usr/X11/lib",
"/usr/X11R6/lib",
"../deps/jpeg-6b/obj/release.$(PLATFORM)",
"../deps/libpng-1.4.0/obj/release.$(PLATFORM)",
msgid "Down"
msgstr "Down"
-#: ./src/gui/GuiApplication.ec:100
+#: ./src/gui/GuiApplication.ec:102
msgid "Driver/Mode switch failed"
msgstr "Driver/Mode switch failed"
-#: ./src/gui/GuiApplication.ec:196
+#: ./src/gui/GuiApplication.ec:198
msgid "ECERE Application"
msgstr "ECERE Application"
msgid "Entire Computer"
msgstr "Entire Computer"
-#: ./src/gui/GuiApplication.ec:1271
+#: ./src/gui/GuiApplication.ec:1273
msgid "Error falling back to previous video mode.\n"
msgstr "Error falling back to previous video mode.\n"
msgid "Go To...\tCtrl+G"
msgstr "Go To...\tCtrl+G"
-#: ./src/gui/GuiApplication.ec:96
+#: ./src/gui/GuiApplication.ec:98
msgid "Graphics driver not supported by any user interface system"
msgstr "Graphics driver not supported by any user interface system"
msgstr "No"
#: ./src/sys/System.ec:106
-#: ./src/gui/GuiApplication.ec:95
+#: ./src/gui/GuiApplication.ec:97
msgid "No error"
msgstr "No error"
msgid "Window Style"
msgstr "Window Style"
-#: ./src/gui/GuiApplication.ec:97
+#: ./src/gui/GuiApplication.ec:99
msgid "Window creation failed"
msgstr "Window creation failed"
-#: ./src/gui/GuiApplication.ec:98
+#: ./src/gui/GuiApplication.ec:100
msgid "Window graphics loading failed"
msgstr "Window graphics loading failed"
#define GL_CLAMP_TO_EDGE 0x812F
-static bool useSingleGLContext = false;
-
class DisplayData : struct
{
ColorAlpha * flippingBuffer;
int nIndices;
};
+#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
static int primitiveTypes[RenderPrimitiveType] =
{
GL_POINTS, GL_LINES, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, GL_LINE_STRIP
};
+#endif
int current;
void *previous;
glDisable(GL_MULTISAMPLE_ARB);
CocoaGlAssert();
+#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
display.ambient = Color { 50,50,50 };
+#endif
printf("CocoaOpenGLDisplayDriver:CreateDisplay %p %s:%i\n", display.window, __FILE__, __LINE__);
return result;
printf("glGetError():%i\n", glGetError());
}
+#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
void SetRenderState(Display display, RenderState state, uint value)
{
printf("CocoaOpenGLDisplayDriver:SetRenderState STUB! %s:%i\n", __FILE__, __LINE__);
{
printf("CocoaOpenGLDisplayDriver: STUB! %s:%i\n", __FILE__, __LINE__);
- if(display.display3D.mesh && glUnlockArraysEXT)
- glUnlockArraysEXT();
+ /*if(display.display3D.mesh && glUnlockArraysEXT)
+ glUnlockArraysEXT();*/
if(mesh)
{
glDisableClientState(GL_COLOR_ARRAY);
}
- if(glLockArraysEXT) glLockArraysEXT(0, mesh.nVertices);
+ //if(glLockArraysEXT) glLockArraysEXT(0, mesh.nVertices);
}
else if(glBindBufferARB)
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
glMultMatrixd(matrix.array);
}
+#endif
}
-
-public void UseSingleGLContext(bool useSingle)
-{
- printf("CocoaOpenGLDisplayDriver: STUB! %s:%i\n", __FILE__, __LINE__);
- useSingleGLContext = useSingle;
-}
-
#endif
+#if !defined(__APPLE__)
void (APIENTRY * glBindBufferARB) (GLenum target, GLuint buffer);
void (APIENTRY * glGenBuffersARB) (GLsizei n, GLuint *buffers);
void (APIENTRY * glDeleteBuffersARB) (GLsizei n, const GLuint *buffers);
void (APIENTRY * glBufferDataARB) (GLenum target, int size, const GLvoid *data, GLenum usage);
+#endif
#endif
int nIndices;
};
+#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
static int primitiveTypes[RenderPrimitiveType] =
{
GL_POINTS, GL_LINES, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, GL_LINE_STRIP
};
+#endif
int current;
void * previous;
glClearDepth(1.0);
glDisable(GL_MULTISAMPLE_ARB);
}
+#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
display.ambient = Color { 50,50,50 };
+#endif
if(!useSingleGLContext)
#if defined(__WIN32__)
#endif
}
}
-
+#if !defined(ECERE_NO3D) && !defined(ECERE_VANILLA)
void SetRenderState(Display display, RenderState state, uint value)
{
OGLDisplay oglDisplay = display.driverData;
{
//Logf("SelectMesh\n");
-#ifndef __ANDROID__
+#if !defined( __ANDROID__) && !defined(__APPLE__)
if(display.display3D.mesh && glUnlockArraysEXT)
glUnlockArraysEXT();
#endif
glDisableClientState(GL_COLOR_ARRAY);
}
-#ifndef __ANDROID__
+#if !defined(__ANDROID__) && !defined(__APPLE__)
if(glLockArraysEXT) glLockArraysEXT(0, mesh.nVertices);
#endif
}
glMultMatrixd(matrix.array);
}
+#endif
}
public void UseSingleGLContext(bool useSingle)
#if defined(__APPLE__)
import "CocoaInterface"
-#elif defined(__unix__) && !defined(__ANDROID__)
+#endif
+
+#if defined(__unix__) && !defined(__ANDROID__)
import "XInterface"
#endif
if (driver) {
defaultDriver = driver;
} else {
- defaultDriver = "CocoaOpenGL";
+ defaultDriver = "X"; //"CocoaOpenGL";
}
}
#elif defined(__ANDROID__)
}
// printf("Work Area width: %d, height %d\n", w, h);
}
-
+
if(desktopX != x || desktopY != y || desktopW != w || desktopH != h)
{
guiApp.SetDesktopPosition(x, y, w, h, updateChildren);
if(maxVert && maxHorz)
{
if(window.state != maximized)
- window.state = maximized;
+ *&window.state = maximized;
}
else if(isMinimized)
{
if(window.state != minimized)
- window.state = minimized;
+ *&window.state = minimized;
}
else if(window.state != normal)
- window.state = normal;
+ *&window.state = normal;
}
}
{
}
case PropertyNotify:
{
+ XWindowData windowData = window.windowData;
XPropertyEvent * event = (XPropertyEvent *) thisEvent;
if(event->atom == atoms[_net_frame_extents] &&
- event->state == PropertyNewValue && window.windowData)
+ event->state == PropertyNewValue && windowData)
{
int format, len, fill;
Atom type;
&fill, &data) == Success && data)
{
int *extents = (int *)data;
- XWindowData windowData = window.windowData;
bool hadFrameExtents = windowData.gotFrameExtents;
windowData.decor =
{
XFree(data);
}
+ else
+ windowData.gotFrameExtents = true; // Unsupported?
}
break;
}
}
{
-#if defined(__APPLE__)
+#if 0 //defined(__APPLE__)
Atom hints[2] =
{
parentWindow ? atoms[_net_wm_window_type_popup_menu] : atoms[_net_wm_window_type_normal]
if(window.nativeDecorations)
{
XWindowData windowData = window.windowData;
+#if !defined(__APPLE__)
+ // TODO: How to handle frame extents not supported?
if(!windowData.gotFrameExtents || window.state == maximized) return;
+#endif
w -= window.size.w - window.clientSize.w;
h -= window.size.h - window.clientSize.h;
}
define eccDefaultCommand = "ecc";
define ecsDefaultCommand = "ecs";
define earDefaultCommand = "ear";
-define cppDefaultCommand = "gcc"; // As per #624 we decided to default to "gcc"... "cpp";
+define cppDefaultCommand = "gcc"; // As per #624 we decided to default to "gcc"...
define ccDefaultCommand = "gcc";
define cxxDefaultCommand = "g++";
if(compiler.sysroot && compiler.sysroot[0])
{
f.Printf("SYSROOT := %s\n", compiler.sysroot);
- f.Puts("_SYSROOT := $(space)--sysroot=$(SYSROOT)\n");
+ // Moved this to crossplatform.mk
+ //f.Puts("_SYSROOT := $(space)--sysroot=$(SYSROOT)\n");
f.Puts("\n");
}