Skip to content

Commit

Permalink
GET WIFI ANYWHERE YOU GO!
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePlank committed Jul 21, 2024
1 parent 8549b12 commit ff1fed5
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 7 deletions.
10 changes: 4 additions & 6 deletions generator/GLADGenetator.hx
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ class GLADGenetator {
functionBody.add('\thl_add_root(&$paramName);\n');
functionBody.add('\tdebugFunc = $paramName;\n');
return 'onDebugData';
},
'GLuint *' => (functionBody:StringBuf, paramName:String) -> {
return '&$paramName';
},
}
];


Expand All @@ -181,7 +178,7 @@ class GLADGenetator {
'GL_VERSION_4_2',
'GL_VERSION_4_3',
'GL_VERSION_4_4'
], appendFile: 'glInclude', haxeName: 'OpenGL', defineName: 'GLAD_GL_IMPLEMENTATION'},
], appendFile: 'glInclude', haxeName: 'OpenGL', defineName: 'GLAD_GL_IMPLEMENTATION', exclude: ~/\bglGen\w*\b/},
// will do later when im not lazy
// {name: 'vulkan', output: 'out/vulkan', xmlName: 'vk.xml', lightColor: 91, darkColor: 31, features: [
// 'VK_VERSION_1_0',
Expand Down Expand Up @@ -267,7 +264,7 @@ class GLADGenetator {
var proto = command.elementsNamed('proto').next();
var name = proto.elementsNamed('name').next().firstChild().nodeValue;

if (!requiredFunctions.contains(name) /* || data.exclude.match(name) */) continue;
if (!requiredFunctions.contains(name) || data.exclude.match(name)) continue;

var jaxeReturn:String = '';
var typeThing:StringBuf = new StringBuf();
Expand Down Expand Up @@ -325,6 +322,7 @@ class GLADGenetator {
typeStr = typeStr.replace('const', '');
typeStr = typeStr.ltrim();


if (argumentMap.exists(typeStr.rtrim())) commands.add(argumentMap[typeStr.rtrim()]);
else commands.add(typeStr);
commands.add(func.firstChild().nodeValue);
Expand Down
72 changes: 71 additions & 1 deletion generator/glInclude.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,74 @@ HL_PRIM int FUNC_NAME(glad_load_gl)() {
return gladLoadGL(glfwGetProcAddress);
}

DEFINE_PRIM(_I32, PRIM_NAME(glad_load_gl), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(glad_load_gl), _NO_ARG);

HL_PRIM int FUNC_NAME(gl_gen_buffers)() {
GLuint buf;
glGenBuffers(1, &buf);
return buf;
}

HL_PRIM int FUNC_NAME(gl_gen_framebuffers)() {
GLuint buf;
glGenFramebuffers(1, &buf);
return buf;
}

HL_PRIM int FUNC_NAME(gl_gen_program_pipelines)() {
GLuint pipe;
glGenProgramPipelines(1, &pipe);
return pipe;
}

HL_PRIM int FUNC_NAME(gl_gen_queries)() {
GLuint queer;
glGenQueries(1, &queer);
return queer;
}

HL_PRIM int FUNC_NAME(gl_gen_renderbuffers)() {
GLuint rend;
glGenRenderbuffers(1, &rend);
return queer;
}

HL_PRIM int FUNC_NAME(gl_gen_samplers)() {
GLuint samplers;
glGenSamplers(1, &samplers);
return samplers;
}

HL_PRIM int FUNC_NAME(gl_gen_textures)() {
GLuint textures;
glGenTextures(1, &textures);
return textures;
}

HL_PRIM int FUNC_NAME(gl_gen_transform_feedbacks)() {
GLuint ids;
glGenTransformFeedbacks(1, &ids);
return ids;
}

HL_PRIM int FUNC_NAME(gl_gen_vertex_arrays)() {
GLuint arrays;
glGenVertexArrays(1, &arrays);
return arrays;
}

HL_PRIM void FUNC_NAME(gl_generate_mipmap)(GLenum target) {
return glGenerateMipmap(target);
}


DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_buffers), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_framebuffers), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_program_pipelines), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_queries), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_renderbuffers), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_samplers), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_textures), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_transform_feedbacks), _NO_ARG);
DEFINE_PRIM(_I32, PRIM_NAME(gl_gen_vertex_arrays), _NO_ARG);
DEFINE_PRIM(_VOID, PRIM_NAME(gl_generate_mipmap), _I32);

0 comments on commit ff1fed5

Please sign in to comment.