Mark Sibly 7 years ago
parent
commit
12bea4e577

+ 0 - 167
modules/mojo/graphics/glexts/exts.txt

@@ -1,167 +0,0 @@
-/*
-
-Vendor: Google Inc.
-Version: OpenGL ES 2.0 (ANGLE 2.1.0.4b4cdff894f4)
-Renderer: ANGLE (NVIDIA Corporation GeForce GTX 970/PCIe/SSE2 OpenGL 4.5 compatibility)
-
-GL_OES_element_index_uint
-GL_OES_packed_depth_stencil
-GL_OES_get_program_binary
-GL_OES_rgb8_rgba8
-GL_EXT_texture_format_BGRA8888
-GL_EXT_read_format_bgra
-GL_OES_mapbuffer
-GL_EXT_map_buffer_range
-GL_EXT_color_buffer_half_float
-GL_OES_texture_half_float
-GL_OES_texture_half_float_linear
-GL_OES_texture_float
-GL_OES_texture_float_linear
-GL_EXT_texture_rg
-GL_EXT_texture_compression_dxt1
-GL_ANGLE_texture_compression_dxt3
-GL_ANGLE_texture_compression_dxt5
-GL_OES_compressed_ETC1_RGB8_texture
-GL_EXT_sRGB
-GL_ANGLE_depth_texture
-GL_OES_depth32
-GL_EXT_texture_storage
-GL_OES_texture_npot
-GL_EXT_draw_buffers
-GL_EXT_texture_filter_anisotropic
-GL_EXT_occlusion_query_boolean
-GL_NV_fence
-GL_EXT_disjoint_timer_query
-GL_EXT_blend_minmax
-GL_ANGLE_framebuffer_blit
-GL_ANGLE_framebuffer_multisample
-GL_ANGLE_instanced_arrays
-GL_OES_standard_derivatives
-GL_EXT_shader_texture_lod
-GL_EXT_frag_depth
-GL_OES_fbo_render_mipmap
-GL_EXT_debug_marker
-GL_EXT_unpack_subimage
-GL_NV_pack_subimage
-GL_OES_vertex_array_object
-GL_KHR_debug
-GL_CHROMIUM_bind_uniform_location
-GL_EXT_multisample_compatibility
-GL_CHROMIUM_framebuffer_mixed_samples
-
-*/
-
-/*
-
-Chrome Version 58.0.3029.110 (64-bit)
-
-Vendor: WebKit
-Version: OpenGL ES 2.0 (WebGL 1.0 (OpenGL ES 2.0 Chromium))
-Renderer: WebKit WebGL
-
-ANGLE_instanced_arrays
-GL_ANGLE_instanced_arrays
-EXT_blend_minmax
-GL_EXT_blend_minmax
-EXT_disjoint_timer_query
-GL_EXT_disjoint_timer_query
-EXT_frag_depth
-GL_EXT_frag_depth
-EXT_shader_texture_lod
-GL_EXT_shader_texture_lod
-EXT_sRGB
-GL_EXT_sRGB
-EXT_texture_filter_anisotropic
-GL_EXT_texture_filter_anisotropic
-WEBKIT_EXT_texture_filter_anisotropic
-GL_WEBKIT_EXT_texture_filter_anisotropic
-OES_element_index_uint
-GL_OES_element_index_uint
-OES_standard_derivatives
-GL_OES_standard_derivatives
-OES_texture_float
-GL_OES_texture_float
-OES_texture_float_linear
-GL_OES_texture_float_linear
-OES_texture_half_float
-GL_OES_texture_half_float
-OES_texture_half_float_linear
-GL_OES_texture_half_float_linear
-OES_vertex_array_object
-GL_OES_vertex_array_object
-WEBGL_compressed_texture_s3tc
-GL_WEBGL_compressed_texture_s3tc
-WEBKIT_WEBGL_compressed_texture_s3tc
-GL_WEBKIT_WEBGL_compressed_texture_s3tc
-WEBGL_debug_renderer_info
-GL_WEBGL_debug_renderer_info
-WEBGL_debug_shaders
-GL_WEBGL_debug_shaders
-WEBGL_depth_texture
-GL_WEBGL_depth_texture
-WEBKIT_WEBGL_depth_texture
-GL_WEBKIT_WEBGL_depth_texture
-WEBGL_draw_buffers
-GL_WEBGL_draw_buffers
-WEBGL_lose_context
-GL_WEBGL_lose_context
-WEBKIT_WEBGL_lose_context
-GL_WEBKIT_WEBGL_lose_context
-*/
-
-/*
-
-Firefox Nightly: 55.0a1 (2017-05-11) (64-bit)
-
-Vendor: Mozilla
-Version: OpenGL ES 2.0 (WebGL 1.0)
-Renderer: Mozilla
-
-ANGLE_instanced_arrays
-GL_ANGLE_instanced_arrays
-EXT_blend_minmax
-GL_EXT_blend_minmax
-EXT_color_buffer_half_float
-GL_EXT_color_buffer_half_float
-EXT_frag_depth
-GL_EXT_frag_depth
-EXT_shader_texture_lod
-GL_EXT_shader_texture_lod
-EXT_texture_filter_anisotropic
-GL_EXT_texture_filter_anisotropic
-EXT_disjoint_timer_query
-GL_EXT_disjoint_timer_query
-OES_element_index_uint
-GL_OES_element_index_uint
-OES_standard_derivatives
-GL_OES_standard_derivatives
-OES_texture_float
-GL_OES_texture_float
-OES_texture_float_linear
-GL_OES_texture_float_linear
-OES_texture_half_float
-GL_OES_texture_half_float
-OES_texture_half_float_linear
-GL_OES_texture_half_float_linear
-OES_vertex_array_object
-GL_OES_vertex_array_object
-WEBGL_color_buffer_float
-GL_WEBGL_color_buffer_float
-WEBGL_compressed_texture_s3tc
-GL_WEBGL_compressed_texture_s3tc
-WEBGL_debug_renderer_info
-GL_WEBGL_debug_renderer_info
-WEBGL_depth_texture
-GL_WEBGL_depth_texture
-WEBGL_draw_buffers
-GL_WEBGL_draw_buffers
-WEBGL_lose_context
-GL_WEBGL_lose_context
-MOZ_WEBGL_lose_context
-GL_MOZ_WEBGL_lose_context
-MOZ_WEBGL_compressed_texture_s3tc
-GL_MOZ_WEBGL_compressed_texture_s3tc
-MOZ_WEBGL_depth_texture
-GL_MOZ_WEBGL_depth_texture
-*/
-

+ 0 - 83
modules/mojo/graphics/glexts/glexts.cpp

@@ -1,83 +0,0 @@
-
-#include "glexts.h"
-
-#include <bbmonkey.h>
-
-extern "C" void* SDL_GL_GetProcAddress( const char *proc );
-extern "C" int SDL_GL_ExtensionSupported( const char *extension );
-
-#if __EMSCRIPTEN__
-extern "C" GL_APICALL void GL_APIENTRY glDrawBuffers( GLsizei n,const GLenum *bufs );
-#endif
-
-namespace bbGLexts{
-
-	bool GL_draw_buffers=true;
-	bool GL_texture_float;
-	bool GL_texture_half_float;
-	bool GL_depth_texture;
-	bool GL_seamless_cube_map;
-	bool GL_texture_filter_anisotropic;
-	bool GL_standard_derivatives;
-	
-	PFNGLDRAWBUFFERSPROC glDrawBuffers;
-	
-	void init(){
-	
-		static bool done;
-		if( done ) return;
-		done=true;
-		
-		#if __EMSCRIPTEN__
-
-		if( GL_draw_buffers=SDL_GL_ExtensionSupported( "GL_WEBGL_draw_buffers" ) ){
-	
-			// Don't actually call this, will crash emscripten...extension is 'just there'!
-			//
-			// glDrawBuffers=(void(*)(int,const GLenum*)) SDL_GL_GetProcAddress( "glDrawBuffersWEBGL" );
-			
-			glDrawBuffers=::glDrawBuffers;
-		}
-		
-		#else
-	
-		if( GL_draw_buffers=SDL_GL_ExtensionSupported( "GL_EXT_draw_buffers" ) ){
-		
-			glDrawBuffers=(PFNGLDRAWBUFFERSPROC)SDL_GL_GetProcAddress( "glDrawBuffersEXT" );
-			
-		}else if( GL_draw_buffers=SDL_GL_ExtensionSupported( "GL_NV_draw_buffers" ) ){
-
-			glDrawBuffers=(PFNGLDRAWBUFFERSPROC)SDL_GL_GetProcAddress( "glDrawBuffersNV" );
-		}
-		
-		#endif
-		
-		GL_texture_float=SDL_GL_ExtensionSupported( "GL_EXT_texture_float" ) ||
-			SDL_GL_ExtensionSupported( "GL_ANGLE_texture_half_float" ) ||
-			SDL_GL_ExtensionSupported( "GL_WEBGL_texture_float" ) ||
-			SDL_GL_ExtensionSupported( "GL_OES_texture_float" );
-		
-		GL_texture_half_float=SDL_GL_ExtensionSupported( "GL_EXT_texture_half_float" ) ||
-			SDL_GL_ExtensionSupported( "GL_ANGLE_texture_half_float" ) ||
-			SDL_GL_ExtensionSupported( "GL_WEBGL_texture_half_float" ) ||
-			SDL_GL_ExtensionSupported( "GL_OES_texture_half_float" );
-		
-		GL_depth_texture=SDL_GL_ExtensionSupported( "GL_EXT_depth_texture" ) || 
-			SDL_GL_ExtensionSupported( "GL_ANGLE_depth_texture" ) ||
-			SDL_GL_ExtensionSupported( "GL_WEBGL_depth_texture" ) ||
-			SDL_GL_ExtensionSupported( "GL_OES_depth_texture" );
-		
-		GL_seamless_cube_map=SDL_GL_ExtensionSupported( "GL_ARB_seamless_cube_map" );
-			
-		GL_texture_filter_anisotropic=SDL_GL_ExtensionSupported( "GL_EXT_texture_filter_anisotropic" );
-		
-		GL_standard_derivatives=SDL_GL_ExtensionSupported( "GL_OES_standard_derivatives" );
-	
-//		bb_printf( "GL_draw_buffers=%i\n",int( GL_draw_buffers ) );
-//		bb_printf( "GL_texture_float=%i\n",int( GL_texture_float ) );
-//		bb_printf( "GL_texture_half_float=%i\n",int( GL_texture_half_float ) );
-//		bb_printf( "GL_depth_texture=%i\n",int( GL_depth_texture ) );
-//		fflush( stdout );
-	}
-	
-}

+ 0 - 28
modules/mojo/graphics/glexts/glexts.h

@@ -1,28 +0,0 @@
-
-#ifndef BB_GL_EXTS
-#define BB_GL_EXTS
-
-#if __APPLE__
-#include <OpenGLES/ES2/gl.h>
-#else
-#include <GLES2/gl2.h>
-#endif
-
-namespace bbGLexts{
-
-	extern bool GL_draw_buffers;
-	extern bool GL_texture_float;
-	extern bool GL_texture_half_float;
-	extern bool GL_depth_texture;
-	extern bool GL_seamless_cube_map;
-	extern bool GL_texture_filter_anisotropic;
-	extern bool GL_standard_derivatives;
-	
-	typedef void (GL_APIENTRY *PFNGLDRAWBUFFERSPROC)( GLsizei n,const GLenum *bufs );
-
-	extern PFNGLDRAWBUFFERSPROC glDrawBuffers;
-	
-	void init();
-}
-
-#endif

+ 0 - 120
modules/mojo/graphics/glexts/glexts.monkey2

@@ -1,120 +0,0 @@
-
-Namespace mojo.graphics.glexts
-
-#If __TARGET__="windows" Or __MOBILE_TARGET__ Or __WEB_TARGET__
-
-#Import "glexts.cpp"
-#Import "glexts.h"
-
-#Endif
-
-Const GL_TEXTURE_MAX_ANISOTROPY:=$84FE
-
-Const GL_MAX_TEXTURE_MAX_ANISOTROPY:=$84FF
-
-Const GL_TEXTURE_CUBE_MAP_SEAMLESS:=$884f
-
-Const GL_DRAW_BUFFER:=$0c01
-
-Const GL_READ_BUFFER:=$0c01
-
-Const GL_HALF_FLOAT:Int=$8D61
-
-Const GL_MAX_COLOR_ATTACHMENTS:=$8CDF
-
-'Const GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:=$8CD9
-
-'Const GL_COLOR_ATTACHMENT0:Int=$8cE0
-Const GL_COLOR_ATTACHMENT1:Int=$8CE1
-Const GL_COLOR_ATTACHMENT2:Int=$8CE2
-Const GL_COLOR_ATTACHMENT3:Int=$8CE3
-Const GL_COLOR_ATTACHMENT4:Int=$8CE4
-Const GL_COLOR_ATTACHMENT5:Int=$8CE5
-Const GL_COLOR_ATTACHMENT6:Int=$8CE6
-Const GL_COLOR_ATTACHMENT7:Int=$8CE7
-Const GL_COLOR_ATTACHMENT8:Int=$8CE8
-Const GL_COLOR_ATTACHMENT9:Int=$8CE9
-Const GL_COLOR_ATTACHMENT10:Int=$8CEA
-Const GL_COLOR_ATTACHMENT11:Int=$8CEB
-Const GL_COLOR_ATTACHMENT12:Int=$8CEC
-Const GL_COLOR_ATTACHMENT13:Int=$8CED
-Const GL_COLOR_ATTACHMENT14:Int=$8CEE
-Const GL_COLOR_ATTACHMENT15:Int=$8CEF
-
-'GLES2 targets
-'
-#If __TARGET__="windows" Or __MOBILE_TARGET__ Or __WEB_TARGET__
-
-Const GL_draw_buffer:Bool=False
-Const GL_read_buffer:Bool=False
-Const GL_seamless_cube_map:bool=False
-
-Extern
-
-Const GL_draw_buffers:Bool="bbGLexts::GL_draw_buffers"
-Const GL_depth_texture:bool="bbGLexts::GL_depth_texture"
-Const GL_texture_float:Bool="bbGLexts::GL_texture_float"
-Const GL_texture_half_float:bool="bbGLexts::GL_texture_half_float"
-Const GL_texture_filter_anisotropic:Bool="bbGLexts::GL_texture_filter_anisotropic"
-Const GL_standard_derivatives:Bool="bbGLexts::GL_standard_derivatives"
-
-Function glDrawBuffers( n:Int,bufs:GLenum Ptr )="bbGLexts::glDrawBuffers"
-
-Function InitGLexts()="bbGLexts::init"
-	
-Public
-	
-Function glDrawBuffer( mode:GLenum )
-	RuntimeError( "glDrawBuffer unsupported" )
-End
-
-
-Function glReadBuffer( mode:GLenum )
-	RuntimeError( "glReadBuffer unsupported" )
-End
-
-'OpenGL targets
-'
-#Elseif __TARGET__="macos" Or __TARGET__="linux"
-
-Const GL_draw_buffer:Bool=True
-Const GL_read_buffer:Bool=True
-Const GL_draw_buffers:Bool=True
-Const GL_depth_texture:bool=True
-Const GL_texture_float:Bool=True
-Const GL_texture_half_float:bool=True
-Const GL_seamless_cube_map:bool=True
-Const GL_texture_filter_anisotropic:Bool=True
-
-Extern
-
-Function glDrawBuffer( mode:GLenum )
-Function glReadBuffer( mode:GLenum )
-Function glDrawBuffers( n:Int,bufs:GLenum Ptr )
-	
-Public
-
-Function InitGLexts()
-End
-
-'?
-#Else
-
-Const GL_draw_buffer:Bool=False
-Const GL_read_buffer:Bool=False
-Const GL_draw_buffers:Bool=False
-Const GL_depth_texture:bool=False
-Const GL_texture_float:Bool=False
-Const GL_texture_half_float:bool=False
-Const GL_seamless_cube_map:Bool=False
-Const GL_texture_filter_anisotropic:Bool=False
-
-Function glDrawBuffers( n:Int,bufs:GLenum Ptr )
-	RuntimeError( "glDrawBuffers unsupported" )
-End
-
-Function InitGLexts()
-End
-
-#Endif
-

+ 0 - 124
modules/mojo/graphics/glexts/test.monkey2

@@ -1,124 +0,0 @@
-
-Namespace myapp
-
-#Import "<std>"
-#Import "<mojo>"
-
-Using std..
-Using mojo..
-
-Class MyWindow Extends GLWindow
-
-	Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=Null )
-
-		Super.New( title,width,height,flags )
-		
-		BeginGL()
-		
-		Print glGetString( GL_VENDOR )
-		Print glGetString( GL_VERSION )
-		Print glGetString( GL_RENDERER )
-		Print glGetString( GL_EXTENSIONS ).Replace( " ","~n" )
-		
-		Print ""
-
-		InitGLexts()
-		
-		glCheck()
-		
-		Local gltexs:=New GLuint[4]
-		
-		glGenTextures( gltexs.Length,gltexs.Data )
-		
-		glBindTexture( GL_TEXTURE_2D,gltexs[0] )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST )
-		glTexImage2D( GL_TEXTURE_2D,0,GL_RGBA,640,480,0,GL_RGBA,GL_HALF_FLOAT,Null )
-'		glTexImage2D( GL_TEXTURE_2D,0,GL_RGBA,640,480,0,GL_RGBA,GL_UNSIGNED_BYTE,Null )
-		Print "texture[0]="+gltexs[0]
-		glCheck()
-		
-		glBindTexture( GL_TEXTURE_2D,gltexs[1] )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST )
-		glTexImage2D( GL_TEXTURE_2D,0,GL_RGBA,640,480,0,GL_RGBA,GL_HALF_FLOAT,Null )
-'		glTexImage2D( GL_TEXTURE_2D,0,GL_RGBA,640,480,0,GL_RGBA,GL_UNSIGNED_BYTE,Null )
-		Print "texture[1]="+gltexs[1]
-		glCheck()
-		
-		glBindTexture( GL_TEXTURE_2D,gltexs[2] )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST )
-		glTexImage2D( GL_TEXTURE_2D,0,GL_RGBA,640,480,0,GL_RGBA,GL_HALF_FLOAT,Null )
-'		glTexImage2D( GL_TEXTURE_2D,0,GL_RGBA,640,480,0,GL_RGBA,GL_UNSIGNED_BYTE,Null )
-		Print "texture[2]="+gltexs[2]
-		glCheck()
-		
-		glBindTexture( GL_TEXTURE_2D,gltexs[3] )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST )
-		glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST )
-		glTexImage2D( GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT,640,480,0,GL_DEPTH_COMPONENT,GL_UNSIGNED_INT,Null )
-		Print "texture[3]="+gltexs[3]
-		glCheck()
-		
-		glBindTexture( GL_TEXTURE_2D,0 )
-		
-		Local glfb:GLuint
-		
-		glGenFramebuffers( 1,Varptr glfb )
-		glCheck()
-		
-		glBindFramebuffer( GL_FRAMEBUFFER,glfb )
-		glCheck()
-		
-		Local i:Int
-		glGetIntegerv( GL_MAX_COLOR_ATTACHMENTS,Varptr i )
-		Print "MAX_COLOR_ATTACHMENTS="+i
-		
-		glFramebufferTexture2D( GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_TEXTURE_2D,gltexs[0],0 )
-		glFramebufferTexture2D( GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT1,GL_TEXTURE_2D,gltexs[1],0 )
-		glFramebufferTexture2D( GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT2,GL_TEXTURE_2D,gltexs[2],0 )
-		glFramebufferTexture2D( GL_FRAMEBUFFER,GL_DEPTH_ATTACHMENT,GL_TEXTURE_2D,gltexs[3],0 )
-		glCheck()
-		
-		Assert( glCheckFramebufferStatus( GL_FRAMEBUFFER )=GL_FRAMEBUFFER_COMPLETE,"Incomplete framebuffer" )
-		
-		glCheck()
-		
-		glBindFramebuffer( GL_FRAMEBUFFER,0 )
-		
-		glCheck()
-		
-		Print "TEST COMPLETE!"
-		
-		EndGL()
-	End
-
-	Method OnRender( canvas:Canvas ) Override
-	
-		App.RequestRender()
-	
-		canvas.DrawText( "Hello World!",Width/2,Height/2,.5,.5 )
-	End
-	
-End
-
-Function Main()
-
-'	libc.setenv( "SDL_ANGLE_RENDERER","OPENGL",0 )
-	libc.setenv( "SDL_ANGLE_RENDERER","D3D11",0 )
-
-	Local config:=New StringMap<String>
-	
-	config["GL_context_profile"]="es"
-	config["GL_context_major_version"]=2
-	config["GL_context_minor_version"]=0
-
-	config["GL_depth_buffer_enabled"]=1
-
-	New AppInstance( config )
-	
-	New MyWindow
-	
-	App.Run()
-End