Skip to content

Commit 783cd2a

Browse files
Throw instead of doing nothing in unsupported GL functions. (#645)
1 parent 2b43e29 commit 783cd2a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libs/sdl/gl.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,16 @@ HL_PRIM void HL_NAME(gl_tex_image3d)( int target, int level, int internalFormat,
329329
HL_PRIM void HL_NAME(gl_tex_storage2d)( int target, int levels, int internalFormat, int width, int height) {
330330
#ifndef __APPLE__
331331
glTexStorage2D(target, levels, internalFormat, width, height);
332+
#else
333+
hl_error("glTexStorage2d is not supported on Apple platforms");
332334
#endif
333335
}
334336

335337
HL_PRIM void HL_NAME(gl_tex_storage3d)( int target, int levels, int internalFormat, int width, int height, int depth) {
336338
#ifndef __APPLE__
337339
glTexStorage3D(target, levels, internalFormat, width, height, depth);
340+
#else
341+
hl_error("glTexStorage3d is not supported on Apple platforms");
338342
#endif
339343
}
340344

@@ -663,13 +667,15 @@ HL_PRIM int HL_NAME(gl_get_program_resource_index)( vdynamic *p, int type, vstri
663667
char *cname = hl_to_utf8(name->bytes);
664668
return (int)glGetProgramResourceIndex(p->v.i, type, cname);
665669
#else
666-
return 0;
670+
hl_error("glGetProgramResourceIndex is not supported on Apple platforms");
667671
#endif
668672
}
669673

670674
HL_PRIM void HL_NAME(gl_shader_storage_block_binding)( vdynamic *p, int index, int binding ) {
671675
#ifndef __APPLE__
672676
glShaderStorageBlockBinding(p->v.i, index, binding);
677+
#else
678+
hl_error("glShaderStorageBlockBinding is not supported on Apple platforms");
673679
#endif
674680
}
675681

0 commit comments

Comments
 (0)