Skip to content

Commit

Permalink
added more gl functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Jan 8, 2024
1 parent 0ec37e6 commit 82b5310
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/sdl/GLImports.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ GL_IMPORT(glShaderStorageBlockBinding, SHADERSTORAGEBLOCKBINDING);
GL_IMPORT(glMultiDrawElementsIndirect, MULTIDRAWELEMENTSINDIRECT);
GL_IMPORT(glColorMaski, COLORMASKI);

GL_IMPORT(glTexStorage2D, TEXSTORAGE2D);
GL_IMPORT(glTexStorage3D, TEXSTORAGE3D);

#if !defined(HL_MESA)
GL_IMPORT(glGetQueryObjectui64v, GETQUERYOBJECTUI64V);
GL_IMPORT(glQueryCounter, QUERYCOUNTER);
Expand Down
10 changes: 10 additions & 0 deletions libs/sdl/gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ HL_PRIM void HL_NAME(gl_tex_image3d)( int target, int level, int internalFormat,
glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, image);
}

HL_PRIM void HL_NAME(gl_tex_storage2d)( int target, int levels, int internalFormat, int width, int height) {
glTexStorage2D(target, levels, internalFormat, width, height);
}

HL_PRIM void HL_NAME(gl_tex_storage3d)( int target, int levels, int internalFormat, int width, int height, int depth) {
glTexStorage3D(target, levels, internalFormat, width, height, depth);
}

HL_PRIM void HL_NAME(gl_tex_image2d_multisample)( int target, int samples, int internalFormat, int width, int height, bool fixedsamplelocations) {
glTexImage2DMultisample(target, samples, internalFormat, width, height, fixedsamplelocations);
}
Expand Down Expand Up @@ -706,6 +714,8 @@ DEFINE_PRIM(_VOID,gl_tex_parameteri,_I32 _I32 _I32);
DEFINE_PRIM(_VOID,gl_tex_parameterf,_I32 _I32 _F32);
DEFINE_PRIM(_VOID,gl_tex_image2d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES);
DEFINE_PRIM(_VOID,gl_tex_image3d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES);
DEFINE_PRIM(_VOID,gl_tex_storage2d,_I32 _I32 _I32 _I32 _I32);
DEFINE_PRIM(_VOID,gl_tex_storage3d,_I32 _I32 _I32 _I32 _I32 _I32);
DEFINE_PRIM(_VOID,gl_tex_image2d_multisample,_I32 _I32 _I32 _I32 _I32 _BOOL);
DEFINE_PRIM(_VOID,gl_compressed_tex_image2d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES);
DEFINE_PRIM(_VOID,gl_compressed_tex_image3d,_I32 _I32 _I32 _I32 _I32 _I32 _I32 _I32 _BYTES);
Expand Down
32 changes: 32 additions & 0 deletions libs/sdl/sdl/GL.hx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ class GL {
public static function bindTexture( t : Int, texture : Texture ) {
}

@:hlNative("?sdl","gl_bind_image_texture")
public static function bindImageTexture( unit : Int, texture : Int, level : Int, layered : Bool, layer : Int, access : Int, format : Int ) {
}

public static function texParameteri( t : Int, key : Int, value : Int ) {
}

Expand Down Expand Up @@ -252,6 +256,14 @@ class GL {
public static function compressedTexSubImage3D( target : Int, level : Int, xoffset : Int, yoffset : Int, zoffset : Int, width : Int, height : Int, depth : Int, format : Int, type : Int, image : hl.Bytes ) {
}

@:hlNative("?sdl","gl_tex_storage2d")
public static function texStorage2D( target : Int, levels : Int, internalFormat : Int, width : Int, height : Int ) {
}

@:hlNative("?sdl","gl_tex_storage3d")
public static function texStorage3D( target : Int, levels : Int, internalFormat : Int, width : Int, height : Int, depth : Int ) {
}

public static function generateMipmap( t : Int ) {
}

Expand Down Expand Up @@ -781,6 +793,10 @@ class GL {
public static inline var TEXTURE = 0x1702;
public static inline var TEXTURE_2D_ARRAY = 0x8C1A;

public static inline var TEXTURE_1D = 0x0DE0;
public static inline var TEXTURE_1D_ARRAY = 0x8C18;
public static inline var TEXTURE_CUBE_MAP_ARRAY = 0x9009;

public static inline var TEXTURE_CUBE_MAP_SEAMLESS = 0x884F;
public static inline var TEXTURE_CUBE_MAP = 0x8513;
public static inline var TEXTURE_BINDING_CUBE_MAP = 0x8514;
Expand All @@ -792,6 +808,22 @@ class GL {
public static inline var TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
public static inline var MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;

/* Image */

public static inline var READ_ONLY = 0x88B8;
public static inline var WRITE_ONLY = 0x88B9;
public static inline var READ_WRITE = 0x88BA;

public static inline var IMAGE_1D = 0x904C;
public static inline var IMAGE_2D = 0x904D;
public static inline var IMAGE_3D = 0x904E;
public static inline var IMAGE_2D_RECT = 0x904F;
public static inline var IMAGE_CUBE = 0x9050;
public static inline var IMAGE_BUFFER = 0x9051;
public static inline var IMAGE_1D_ARRAY = 0x9052;
public static inline var IMAGE_2D_ARRAY = 0x9053;
public static inline var IMAGE_CUBE_MAP_ARRAY = 0x9054;

/* TextureUnit */
public static inline var TEXTURE0 = 0x84C0;
public static inline var TEXTURE1 = 0x84C1;
Expand Down

0 comments on commit 82b5310

Please sign in to comment.