diff --git a/scripts/__d3d11/__d3d11.gml b/scripts/__d3d11/__d3d11.gml index b6eb25e09..754d95a39 100644 --- a/scripts/__d3d11/__d3d11.gml +++ b/scripts/__d3d11/__d3d11.gml @@ -12,6 +12,7 @@ /// /// @return {String} The last error message. function d3d11_get_error_string() { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define(GMD3D11_PATH, "d3d11_get_error_string", dll_cdecl, ty_string, 0); return external_call(_fn); @@ -27,6 +28,7 @@ function d3d11_get_error_string() { /// /// @return {Real} Returns 1 on success or 0 on fail. function d3d11_texture_set_stage_vs(_slot, _texture) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_vs", dll_cdecl, ty_real, 1, ty_real); texture_set_stage(0, _texture); @@ -62,6 +64,7 @@ function texture_set_stage_vs(_slot, _texture) { /// /// @return {Real} Returns 1 on success or 0 on fail. function d3d11_texture_set_stage_ps(_slot, _texture) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define(GMD3D11_PATH, "d3d11_texture_set_stage_ps", dll_cdecl, ty_real, 1, ty_real); texture_set_stage(0, _texture); @@ -75,6 +78,7 @@ function d3d11_texture_set_stage_ps(_slot, _texture) { /// /// @param {Real} _count Number of instances to draw. Use 0 to disable instanced rendering. function d3d11_draw_instanced(_count) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define(GMD3D11_PATH, "d3d11_draw_instanced", dll_cdecl, ty_real, 1, ty_real); return external_call(_fn, _count); @@ -89,6 +93,7 @@ function d3d11_draw_instanced(_count) { /// @param {Pointer.Texture} _texture The texture to use. /// @param {Real} _count The number of instances to draw. function vertex_submit_instanced(_vbuff, _prim, _texture, _count) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); if (!d3d11_draw_instanced(_count)) return false; @@ -98,6 +103,7 @@ function vertex_submit_instanced(_vbuff, _prim, _texture, _count) { } function vertex_buffer_load(_filename, _vformat) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); var _buffer = buffer_load(_filename); var _vbuffer = vertex_create_buffer_from_buffer(_buffer, _vformat); diff --git a/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml b/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml index 438d8de40..d51d5dffc 100644 --- a/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml +++ b/scripts/__d3d11_cbuffer/__d3d11_cbuffer.gml @@ -3,8 +3,8 @@ /// @desc Starts building a constant buffer. /// /// @see d3d11_cbuffer_end -function d3d11_cbuffer_begin() -{ +function d3d11_cbuffer_begin() { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_begin", dll_cdecl, ty_real, @@ -20,8 +20,8 @@ function d3d11_cbuffer_begin() /// /// @see d3d11_cbuffer_exists /// @see d3d11_cbuffer_update -function d3d11_cbuffer_end() -{ +function d3d11_cbuffer_end() { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_end", dll_cdecl, ty_real, @@ -36,8 +36,8 @@ function d3d11_cbuffer_end() /// @param {Real} _count Number of bools to add into the constant buffer. /// /// @see d3d11_cbuffer_begin -function d3d11_cbuffer_add_bool(_count) -{ +function d3d11_cbuffer_add_bool(_count) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_bool", dll_cdecl, ty_real, @@ -52,8 +52,8 @@ function d3d11_cbuffer_add_bool(_count) /// @param {Real} _count Number of ints to add into the constant buffer. /// /// @see d3d11_cbuffer_begin -function d3d11_cbuffer_add_int(_count) -{ +function d3d11_cbuffer_add_int(_count) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_int", dll_cdecl, ty_real, @@ -68,8 +68,8 @@ function d3d11_cbuffer_add_int(_count) /// @param {Real} _count Number of uints to add into the constant buffer. /// /// @see d3d11_cbuffer_begin -function d3d11_cbuffer_add_uint(_count) -{ +function d3d11_cbuffer_add_uint(_count) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_uint", dll_cdecl, ty_real, @@ -84,8 +84,8 @@ function d3d11_cbuffer_add_uint(_count) /// @param {Real} _count Number of floats to add into the constant buffer. /// /// @see d3d11_cbuffer_begin -function d3d11_cbuffer_add_float(_count) -{ +function d3d11_cbuffer_add_float(_count) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_add_float", dll_cdecl, ty_real, @@ -98,8 +98,8 @@ function d3d11_cbuffer_add_float(_count) /// @desc Retrieves size of a constant buffer in bytes. /// /// @param {Real} The size of the constant buffer in bytes. -function d3d11_cbuffer_get_size(_cbuffer) -{ +function d3d11_cbuffer_get_size(_cbuffer) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_get_size", dll_cdecl, ty_real, @@ -113,8 +113,8 @@ function d3d11_cbuffer_get_size(_cbuffer) /// /// @param {Real} _cbuffer The ID of the constant buffer. /// @param {Id.Buffer} _buffer A buffer with new data. -function d3d11_cbuffer_update(_cbuffer, _buffer) -{ +function d3d11_cbuffer_update(_cbuffer, _buffer) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_update", dll_cdecl, ty_real, @@ -128,8 +128,8 @@ function d3d11_cbuffer_update(_cbuffer, _buffer) /// /// @param {Real} _slot The slot to bind the constant buffer to. /// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot. -function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer) -{ +function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_set_cbuffer_ps", dll_cdecl, ty_real, @@ -143,8 +143,8 @@ function d3d11_shader_set_cbuffer_ps(_slot, _cbuffer) /// /// @param {Real} _slot The slot to bind the constant buffer to. /// @param {Real} _cbuffer The ID of the constant buffer or -1 to ubind the slot. -function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer) -{ +function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_set_cbuffer_vs", dll_cdecl, ty_real, @@ -159,8 +159,8 @@ function d3d11_shader_set_cbuffer_vs(_slot, _cbuffer) /// @param {Real} _cbuffer The ID of the comand buffer. /// /// @return {Bool} Returns true if the constant buffer exists. -function d3d11_cbuffer_exists(_cbuffer) -{ +function d3d11_cbuffer_exists(_cbuffer) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_exists", dll_cdecl, ty_real, @@ -173,8 +173,8 @@ function d3d11_cbuffer_exists(_cbuffer) /// @desc Destroys a constant buffer. /// /// @param {Real} _cbuffer The ID of the constant buffer to destroy. -function d3d11_cbuffer_destroy(_cbuffer) -{ +function d3d11_cbuffer_destroy(_cbuffer) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_cbuffer_destroy", dll_cdecl, ty_real, diff --git a/scripts/__d3d11_shader/__d3d11_shader.gml b/scripts/__d3d11_shader/__d3d11_shader.gml index 542fdcf08..4e77079e1 100644 --- a/scripts/__d3d11_shader/__d3d11_shader.gml +++ b/scripts/__d3d11_shader/__d3d11_shader.gml @@ -12,8 +12,8 @@ /// @return {Real} The ID of the pixel shader or -1 on fail. /// /// @see d3d11_get_error_string -function d3d11_shader_compile_ps(_file, _entryPoint, _profile) -{ +function d3d11_shader_compile_ps(_file, _entryPoint, _profile) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_compile_ps", dll_cdecl, ty_real, @@ -32,8 +32,8 @@ function d3d11_shader_compile_ps(_file, _entryPoint, _profile) /// @return {Real} The ID of the vertex shader or -1 on fail. /// /// @see d3d11_get_error_string -function d3d11_shader_compile_vs(_file, _entryPoint, _profile) -{ +function d3d11_shader_compile_vs(_file, _entryPoint, _profile) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_compile_vs", dll_cdecl, ty_real, @@ -47,8 +47,8 @@ function d3d11_shader_compile_vs(_file, _entryPoint, _profile) /// shader with a custom one. /// /// @param {Real} _ps The ID of the shader or -1 to disable the override. -function d3d11_shader_override_ps(_ps) -{ +function d3d11_shader_override_ps(_ps) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_override_ps", dll_cdecl, ty_real, @@ -64,8 +64,8 @@ function d3d11_shader_override_ps(_ps) /// @param {Real} _vs The ID of the shader or -1 to disable the override. The /// vertex format expected by the shader must be compatible with the overriden /// shader! -function d3d11_shader_override_vs(_vs) -{ +function d3d11_shader_override_vs(_vs) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_override_vs", dll_cdecl, ty_real, @@ -80,8 +80,8 @@ function d3d11_shader_override_vs(_vs) /// @param {Real} _ps The ID of the shader. /// /// @return {Bool} Returns true if the shader exists. -function d3d11_shader_exists(_shader) -{ +function d3d11_shader_exists(_shader) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_exists", dll_cdecl, ty_real, @@ -94,8 +94,8 @@ function d3d11_shader_exists(_shader) /// @desc Destroys a shader. /// /// @param {Real} _shader The ID of the shader to destroy. -function d3d11_shader_destroy(_shader) -{ +function d3d11_shader_destroy(_shader) { + if(!GMD3D11_IS_SUPPORTED) return; gml_pragma("forceinline"); static _fn = external_define( GMD3D11_PATH, "d3d11_shader_destroy", dll_cdecl, ty_real,