Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
e39a6242
Commit
e39a6242
authored
Jan 05, 2017
by
Rémi Verschelde
Committed by
GitHub
Jan 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7429 from BastiaanOlij/glew3-osx
Fixing compilation errors for gles3 for Mac OS X
parents
d8e54b1e
5e717ed8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
52 additions
and
26 deletions
+52
-26
.travis.yml
.travis.yml
+1
-1
glad.h
drivers/gl_context/glad/glad.h
+14
-0
rasterizer_gles3.cpp
drivers/gles3/rasterizer_gles3.cpp
+4
-0
os_osx.h
platform/osx/os_osx.h
+3
-2
os_osx.mm
platform/osx/os_osx.mm
+17
-18
platform_config.h
platform/osx/platform_config.h
+3
-2
os_windows.cpp
platform/windows/os_windows.cpp
+5
-3
shader_language.h
servers/visual/shader_language.h
+5
-0
No files found.
.travis.yml
View file @
e39a6242
...
...
@@ -12,7 +12,7 @@ os:
env
:
#- GODOT_TARGET=iphone
#
- GODOT_TARGET=osx
-
GODOT_TARGET=osx
-
GODOT_TARGET=x11
#- GODOT_TARGET=android
-
GODOT_TARGET=windows
...
...
drivers/gl_context/glad/glad.h
View file @
e39a6242
...
...
@@ -150,12 +150,26 @@ typedef unsigned int GLhandleARB;
typedef
unsigned
short
GLhalfARB
;
typedef
unsigned
short
GLhalf
;
typedef
GLint
GLfixed
;
// Temporary work around for upstream issue: https://github.com/Dav1dde/glad/issues/70
// Originally fixed by Algorithmus, reapplied in master
#if defined(__APPLE__)
typedef
long
GLintptr
;
typedef
long
GLsizeiptr
;
#else
typedef
ptrdiff_t
GLintptr
;
typedef
ptrdiff_t
GLsizeiptr
;
#endif
typedef
int64_t
GLint64
;
typedef
uint64_t
GLuint64
;
// Temporary work around for upstream issue: https://github.com/Dav1dde/glad/issues/70
// Originally fixed by Algorithmus, reapplied in master
#if defined(__APPLE__)
typedef
long
GLintptrARB
;
typedef
long
GLsizeiptrARB
;
#else
typedef
ptrdiff_t
GLintptrARB
;
typedef
ptrdiff_t
GLsizeiptrARB
;
#endif
typedef
int64_t
GLint64EXT
;
typedef
uint64_t
GLuint64EXT
;
typedef
struct
__GLsync
*
GLsync
;
...
...
drivers/gles3/rasterizer_gles3.cpp
View file @
e39a6242
...
...
@@ -136,9 +136,13 @@ void RasterizerGLES3::initialize() {
ERR_PRINT
(
"Error initializing GLAD"
);
}
#ifdef __APPLE__
// FIXME glDebugMessageCallbackARB does not seem to work on Mac OS X and opengl 3, this may be an issue with our opengl canvas..
#else
glEnable
(
_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB
);
glDebugMessageCallbackARB
(
_gl_debug_print
,
NULL
);
glEnable
(
_EXT_DEBUG_OUTPUT
);
#endif
#endif
...
...
platform/osx/os_osx.h
View file @
e39a6242
...
...
@@ -35,7 +35,7 @@
#include "drivers/unix/os_unix.h"
#include "main/input_default.h"
#include "servers/visual_server.h"
#include "servers/visual/visual_server_wrap_mt.h"
//
#include "servers/visual/visual_server_wrap_mt.h"
#include "servers/visual/rasterizer.h"
#include "servers/physics_server.h"
#include "servers/audio/audio_server_sw.h"
...
...
@@ -58,7 +58,8 @@
class
OS_OSX
:
public
OS_Unix
{
public
:
bool
force_quit
;
Rasterizer
*
rasterizer
;
// rasterizer seems to no longer be given to visual server, its using GLES3 directly?
// Rasterizer *rasterizer;
VisualServer
*
visual_server
;
List
<
String
>
args
;
...
...
platform/osx/os_osx.mm
View file @
e39a6242
...
...
@@ -38,13 +38,14 @@
#include "servers/visual/visual_server_raster.h"
//#include "drivers/opengl/rasterizer_gl.h"
//#include "drivers/gles2/rasterizer_gles2.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "os_osx.h"
#include <stdio.h>
#include <stdlib.h>
#include "print_string.h"
#include "servers/physics/physics_server_sw.h"
#include "drivers/gles2/rasterizer_instance_gles2.h"
#include "servers/visual/visual_server_wrap_mt.h"
//
#include "drivers/gles2/rasterizer_instance_gles2.h"
//
#include "servers/visual/visual_server_wrap_mt.h"
#include "main/main.h"
#include "os/keyboard.h"
#include "dir_access_osx.h"
...
...
@@ -986,13 +987,11 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
window_size.width = p_desired.width;
window_size.height = p_desired.height;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && display_scale>1) {
[window_view setWantsBestResolutionOpenGLSurface:YES];
//if (current_videomode.resizable)
[window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
}
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
// [window_object setTitle:[NSString stringWithUTF8String:"GodotEnginies"]];
[window_object setContentView:window_view];
...
...
@@ -1000,10 +999,8 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
[window_object setAcceptsMouseMovedEvents:YES];
[window_object center];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6)
[window_object setRestorable:NO];
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
unsigned int attributeCount = 0;
...
...
@@ -1022,10 +1019,8 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
ADD_ATTR(NSOpenGLPFADoubleBuffer);
ADD_ATTR(NSOpenGLPFAClosestPolicy);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
if (false/* use gl3*/)
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);
#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/
// we now need OpenGL 3 or better, maybe even change this to 3_3Core ?
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);
ADD_ATTR2(NSOpenGLPFAColorSize, colorBits);
...
...
@@ -1084,15 +1079,19 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
AudioDriverManagerSW::add_driver(&audio_driver_osx);
// only opengl support here...
RasterizerGLES3::register_config();
RasterizerGLES3::make_current();
rasterizer = instance_RasterizerGLES2();
visual_server = memnew( VisualServerRaster(rasterizer) );
if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
// rasterizer = instance_RasterizerGLES2();
// visual_server = memnew( VisualServerRaster(rasterizer) );
visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
}
visual_server = memnew( VisualServerRaster );
// FIXME: Reimplement threaded rendering? Or remove?
// if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
//
// visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
// }
visual_server->init();
visual_server->cursor_set_visible(false, 0);
...
...
@@ -1176,7 +1175,7 @@ void OS_OSX::finalize() {
visual_server->finish();
memdelete(visual_server);
memdelete(rasterizer);
//
memdelete(rasterizer);
physics_server->finish();
memdelete(physics_server);
...
...
platform/osx/platform_config.h
View file @
e39a6242
...
...
@@ -28,6 +28,7 @@
/*************************************************************************/
#include <alloca.h>
#define GLES2_INCLUDE_H "GL/glew.h"
#define GLES3_INCLUDE_H "GL/glew.h"
//#define GLES2_INCLUDE_H "GL/glew.h"
//#define GLES3_INCLUDE_H "GL/glew.h"
#define GLES3_INCLUDE_H "gl_context/glad/glad.h"
#define PTHREAD_RENAME_SELF
platform/windows/os_windows.cpp
View file @
e39a6242
...
...
@@ -1087,13 +1087,15 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_
RasterizerGLES3
::
make_current
();
#else
#ifdef DX9_ENABLED
// FIXME: Does DX support still work now that rasterizer is no longer used?
#ifdef DX9_ENABLED
rasterizer
=
memnew
(
RasterizerDX9
(
hWnd
)
);
#endif
#endif
#endif
visual_server
=
memnew
(
VisualServerRaster
);
//if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
// FIXME: Reimplement threaded rendering? Or remove?
// if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) {
//
// visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD));
// }
...
...
servers/visual/shader_language.h
View file @
e39a6242
...
...
@@ -151,6 +151,11 @@ public:
/* COMPILER */
// lame work around to Apple defining this as a macro in 10.12 SDK
#ifdef TYPE_BOOL
#undef TYPE_BOOL
#endif
enum
DataType
{
TYPE_VOID
,
TYPE_BOOL
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment