Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
VR-demos
Commits
8398735f
Commit
8398735f
authored
Mar 22, 2018
by
lrz
Browse files
Changes to compile in IOS
parent
c745120f
Changes
7
Hide whitespace changes
Inline
Side-by-side
NOMADVRLib/CompileGLShader.cpp
View file @
8398735f
...
...
@@ -69,6 +69,10 @@ GLuint CompileGLShader( const char *pchShaderName, const char *pchVertexShader,
//tess
if
(
pchTessEvalShader
)
{
#if defined (__APPLE__) && !defined (GL_TESS_EVALUATION_SHADER)
eprintf
(
"Tess Eval Shaders unsupported on IOS"
);
return
0
;
#else
GLuint
nSceneTessShader
=
glCreateShader
(
GL_TESS_EVALUATION_SHADER
);
glShaderSource
(
nSceneTessShader
,
1
,
&
pchTessEvalShader
,
nullptr
);
glCompileShader
(
nSceneTessShader
);
...
...
@@ -88,6 +92,7 @@ GLuint CompileGLShader( const char *pchShaderName, const char *pchVertexShader,
}
glAttachShader
(
unProgramID
,
nSceneTessShader
);
glDeleteShader
(
nSceneTessShader
);
// the program hangs onto this once it's attached
#endif
}
glLinkProgram
(
unProgramID
);
...
...
NOMADVRLib/ConfigFile.cpp
View file @
8398735f
...
...
@@ -18,6 +18,7 @@
#include <algorithm>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "ConfigFile.h"
#include "atoms.hpp"
...
...
NOMADVRLib/IsosurfacesGL.cpp
View file @
8398735f
...
...
@@ -305,8 +305,13 @@ bool SetupDepthPeeling(int renderWidth, int renderHeight, int zlayers, GLuint *t
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_DEPTH_COMPONENT32
,
renderWidth
,
renderHeight
,
0
,
GL_DEPTH_COMPONENT
,
GL_UNSIGNED_BYTE
,
0
);
#else // 32 unsupported in GLES 3.0
#ifdef __APPLE__
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_DEPTH_COMPONENT
,
renderWidth
,
renderHeight
,
0
,
GL_DEPTH_COMPONENT
,
GL_FLOAT
,
0
);
#else
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_DEPTH_COMPONENT32F
,
renderWidth
,
renderHeight
,
0
,
GL_DEPTH_COMPONENT
,
GL_FLOAT
,
0
);
#endif
#endif
if
((
e
=
glGetError
())
!=
GL_NO_ERROR
)
...
...
NOMADVRLib/MyGL.h
View file @
8398735f
...
...
@@ -18,6 +18,7 @@
#define __MYGL_H
//FIXME, support more platforms in the future
#ifndef __APPLE__
#if defined(WIN32) || defined(CAVE)
#include <GL/glew.h>
#else // Samsung GearVR + Oculus Mobile
...
...
@@ -36,5 +37,15 @@
#define GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32_OES
#endif
#endif //WIN32
#else //__APPLE__
//#include <OpenGLES/EAGL.h>
#include <OpenGLES/ES3/gl.h>
#include <OpenGLES/ES3/glext.h>
//#ifndef glGenVertexArrays
//#define glGenVertexArrays glGenVertexArraysOES
//#define glBindVertexArray glBindVertexArrayOES
//#define glDeleteVertexArrays glDeleteVertexArraysOES
//#endif
#endif //__APPLE__
#endif //__MYGL_H
NOMADVRLib/atomsGL.cpp
View file @
8398735f
...
...
@@ -60,7 +60,11 @@ GLenum atomTexture(GLuint t)
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA32F
,
finalatoms
,
1
,
0
,
GL_RGBA
,
GL_FLOAT
,
a
);
#ifdef __APPLE__
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA
,
finalatoms
,
1
,
0
,
GL_RGBA
,
GL_FLOAT
,
a
);
#else
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA32F
,
finalatoms
,
1
,
0
,
GL_RGBA
,
GL_FLOAT
,
a
);
#endif
glBindTexture
(
GL_TEXTURE_2D
,
0
);
if
((
e
=
glGetError
())
!=
GL_NO_ERROR
)
{
...
...
NOMADVRLib/polyhedron.cpp
View file @
8398735f
...
...
@@ -90,8 +90,8 @@ const int Tetrahedron::Faces[] = {
const
int
Tetrahedron
::
nVerts
=
4
;
const
float
Tetrahedron
::
Verts
[]
=
{
sqrt
(
2.0
f
)
/
sqrt
(
3.0
f
)
*
1
,
0
,
-
1.0
f
/
sqrt
(
3.0
f
),
-
sqrt
(
2.0
f
)
/
sqrt
(
3.0
f
)
*
1
,
0
,
-
1.0
f
/
sqrt
(
3.0
f
),
0
,
sqrt
(
2.0
f
)
/
sqrt
(
3.0
f
),
1.0
f
/
sqrt
(
3.0
f
),
0
,
-
sqrt
(
2.0
f
)
/
sqrt
(
3.0
f
),
1.0
f
/
sqrt
(
3.0
f
),
};
\ No newline at end of file
sqrtf
(
2.0
f
)
/
sqrtf
(
3.0
f
)
*
1.0
f
,
0.0
f
,
-
1.0
f
/
sqrtf
(
3.0
f
),
-
sqrtf
(
2.0
f
)
/
sqrtf
(
3.0
f
)
*
1.0
f
,
0.0
f
,
-
1.0
f
/
sqrtf
(
3.0
f
),
0.0
f
,
sqrtf
(
2.0
f
)
/
sqrtf
(
3.0
f
),
1.0
f
/
sqrtf
(
3.0
f
),
0.0
f
,
-
sqrtf
(
2.0
f
)
/
sqrtf
(
3.0
f
),
1.0
f
/
sqrtf
(
3.0
f
),
};
NOMADVRLib/polyhedron.h
View file @
8398735f
...
...
@@ -20,6 +20,8 @@
#ifndef __POLYHEDRON_H
#define __POLYHEDRON_H
#include <math.h>
class
Icosahedron
{
public:
static
const
int
nFaces
;
...
...
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