Some adjustments for when lime_opengl is not defined

This commit is contained in:
Joshua Granick
2017-04-12 12:00:35 -07:00
parent f840e43705
commit 17ad0db37a
15 changed files with 64 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -21,4 +21,7 @@ abstract GLBuffer(GLObject) from GLObject to GLObject {
#else
typedef GLBuffer = js.html.webgl.Buffer;
#end
#else
typedef GLBuffer = Dynamic;
#end

View File

@@ -91,9 +91,13 @@ EXTENSIONS, type, version)
abstract GLES2Context(GLES3Context) from GLES3Context from GLRenderContext to WebGLContext {
@:from private static function fromGL (gl:Class<GL>):GLES2Context {
@:from private static function fromGL (gl:#if lime_opengl Class<GL> #else Dynamic #end):GLES2Context {
#if lime_opengl
return cast GL.context;
#else
return null;
#end
}

View File

@@ -3201,9 +3201,13 @@ abstract GLES3Context(GLRenderContext) from GLRenderContext to GLRenderContext t
}
@:from private static function fromGL (gl:Class<GL>):GLES3Context {
@:from private static function fromGL (gl:#if lime_opengl Class<GL> #else Dynamic #end):GLES3Context {
#if lime_opengl
return cast GL.context;
#else
return null;
#end
}

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -21,4 +21,7 @@ abstract GLFramebuffer(GLObject) from GLObject to GLObject {
#else
typedef GLFramebuffer = js.html.webgl.Framebuffer;
#end
#else
typedef GLFramebuffer = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -21,4 +21,7 @@ abstract GLProgram(GLObject) from GLObject to GLObject {
#else
typedef GLProgram = js.html.webgl.Program;
#end
#else
typedef GLProgram = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -22,4 +22,7 @@ abstract GLQuery(GLObject) from GLObject to GLObject {
#else
@:native("WebGLQuery")
extern class GLQuery {}
#end
#else
typedef GLQuery = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -21,4 +21,7 @@ abstract GLRenderbuffer(GLObject) from GLObject to GLObject {
#else
typedef GLRenderbuffer = js.html.webgl.Renderbuffer;
#end
#else
typedef GLRenderbuffer = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -22,4 +22,7 @@ abstract GLSampler(GLObject) from GLObject to GLObject {
#else
@:native("WebGLSampler")
extern class GLSampler {}
#end
#else
typedef GLSampler = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -21,4 +21,7 @@ abstract GLShader(GLObject) from GLObject to GLObject {
#else
typedef GLShader = js.html.webgl.Shader;
#end
#else
typedef GLShader = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -22,4 +22,7 @@ abstract GLSync(GLObject) from GLObject to GLObject {
#else
@:native("WebGLSync")
extern class GLSync {}
#end
#else
typedef GLSync = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -21,4 +21,7 @@ abstract GLTexture(GLObject) from GLObject to GLObject {
#else
typedef GLTexture = js.html.webgl.Texture;
#end
#else
typedef GLTexture = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -22,4 +22,7 @@ abstract GLTransformFeedback(GLObject) from GLObject to GLObject {
#else
@:native("WebGLTransformFeedback")
extern class GLTransformFeedback {}
#end
#else
typedef GLTransformFeedback = Dynamic;
#end

View File

@@ -1,4 +1,4 @@
package lime.graphics.opengl; #if (!js || !html5 || display)
package lime.graphics.opengl; #if lime_opengl #if (!js || !html5 || display)
import lime.graphics.opengl.GL;
@@ -22,4 +22,7 @@ abstract GLVertexArrayObject(GLObject) from GLObject to GLObject {
#else
@:native("WebGLVertexArrayObject")
extern class GLVertexArrayObject {}
#end
#else
typedef GLVertexArrayObject = Dynamic;
#end

View File

@@ -3145,9 +3145,13 @@ abstract WebGL2Context(GLRenderContext) from GLRenderContext to GLRenderContext
}
@:from private static function fromGL (gl:Class<GL>):WebGL2Context {
@:from private static function fromGL (gl:#if lime_opengl Class<GL> #else Dynamic #end):WebGL2Context {
#if lime_opengl
return cast GL.context;
#else
return null;
#end
}

View File

@@ -109,9 +109,13 @@ abstract WebGLContext(WebGL2Context) from GLRenderContext from WebGL2Context {
}
@:from private static function fromGL (gl:Class<GL>):WebGLContext {
@:from private static function fromGL (gl:#if lime_opengl Class<GL> #else Dynamic #end):WebGLContext {
#if lime_opengl
return cast GL.context;
#else
return null;
#end
}