123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179 |
- /*
- * Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
- * Copyright (c) 2021-2022, Jelle Raaijmakers <jelle@gmta.nl>
- * Copyright (c) 2021-2022, Jesse Buhagiar <jooster669@gmail.com>
- * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
- #include <AK/Array.h>
- #include <AK/Debug.h>
- #include <LibGL/GL/gl.h>
- #include <LibGL/GLContext.h>
- extern GL::GLContext* g_gl_context;
- // Transposes input matrices (column-major) to our Matrix (row-major).
- template<typename I, typename O>
- static constexpr Matrix4x4<O> transpose_input_matrix(I const* matrix)
- {
- if constexpr (IsSame<I, O>) {
- // clang-format off
- return {
- matrix[0], matrix[4], matrix[8], matrix[12],
- matrix[1], matrix[5], matrix[9], matrix[13],
- matrix[2], matrix[6], matrix[10], matrix[14],
- matrix[3], matrix[7], matrix[11], matrix[15],
- };
- // clang-format on
- }
- Array<O, 16> elements;
- for (size_t i = 0; i < 16; ++i)
- elements[i] = static_cast<O>(matrix[i]);
- // clang-format off
- return {
- elements[0], elements[4], elements[8], elements[12],
- elements[1], elements[5], elements[9], elements[13],
- elements[2], elements[6], elements[10], elements[14],
- elements[3], elements[7], elements[11], elements[15],
- };
- // clang-format on
- }
- void glActiveTexture(GLenum texture)
- {
- g_gl_context->gl_active_texture(texture);
- }
- void glActiveTextureARB(GLenum texture)
- {
- glActiveTexture(texture);
- }
- void glAlphaFunc(GLenum func, GLclampf ref)
- {
- return g_gl_context->gl_alpha_func(func, ref);
- }
- void glArrayElement(GLint i)
- {
- g_gl_context->gl_array_element(i);
- }
- void glAttachShader(GLuint program, GLuint shader)
- {
- g_gl_context->gl_attach_shader(program, shader);
- }
- void glBegin(GLenum mode)
- {
- g_gl_context->gl_begin(mode);
- }
- void glBindBuffer(GLenum target, GLuint buffer)
- {
- g_gl_context->gl_bind_buffer(target, buffer);
- }
- void glBindTexture(GLenum target, GLuint texture)
- {
- g_gl_context->gl_bind_texture(target, texture);
- }
- void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte const* bitmap)
- {
- g_gl_context->gl_bitmap(width, height, xorig, yorig, xmove, ymove, bitmap);
- }
- void glBlendFunc(GLenum sfactor, GLenum dfactor)
- {
- return g_gl_context->gl_blend_func(sfactor, dfactor);
- }
- void glBufferData(GLenum target, GLsizeiptr size, void const* data, GLenum usage)
- {
- g_gl_context->gl_buffer_data(target, size, data, usage);
- }
- void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, void const* data)
- {
- g_gl_context->gl_buffer_sub_data(target, offset, size, data);
- }
- void glCallList(GLuint list)
- {
- return g_gl_context->gl_call_list(list);
- }
- void glCallLists(GLsizei n, GLenum type, void const* lists)
- {
- return g_gl_context->gl_call_lists(n, type, lists);
- }
- void glClear(GLbitfield mask)
- {
- g_gl_context->gl_clear(mask);
- }
- void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
- {
- g_gl_context->gl_clear_color(red, green, blue, alpha);
- }
- void glClearDepth(GLdouble depth)
- {
- g_gl_context->gl_clear_depth(depth);
- }
- void glClearDepthf(GLfloat depth)
- {
- g_gl_context->gl_clear_depth(static_cast<double>(depth));
- }
- void glClearStencil(GLint s)
- {
- g_gl_context->gl_clear_stencil(s);
- }
- void glClientActiveTexture(GLenum target)
- {
- g_gl_context->gl_client_active_texture(target);
- }
- void glClientActiveTextureARB(GLenum target)
- {
- glClientActiveTexture(target);
- }
- void glClipPlane(GLenum plane, GLdouble const* equation)
- {
- g_gl_context->gl_clip_plane(plane, equation);
- }
- void glColor3d(GLdouble r, GLdouble g, GLdouble b)
- {
- g_gl_context->gl_color(r, g, b, 1.0);
- }
- void glColor3dv(GLdouble const* v)
- {
- g_gl_context->gl_color(v[0], v[1], v[2], 1.0);
- }
- void glColor3f(GLfloat r, GLfloat g, GLfloat b)
- {
- g_gl_context->gl_color(r, g, b, 1.0);
- }
- void glColor3fv(GLfloat const* v)
- {
- g_gl_context->gl_color(v[0], v[1], v[2], 1.0);
- }
- void glColor3ub(GLubyte r, GLubyte g, GLubyte b)
- {
- g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, 1.0);
- }
- void glColor3ubv(GLubyte const* v)
- {
- g_gl_context->gl_color(v[0] / 255.0, v[1] / 255.0, v[2] / 255.0, 1.0);
- }
- void glColor4b(GLbyte r, GLbyte g, GLbyte b, GLbyte a)
- {
- g_gl_context->gl_color(
- (static_cast<double>(r) + 128) / 127.5 - 1,
- (static_cast<double>(g) + 128) / 127.5 - 1,
- (static_cast<double>(b) + 128) / 127.5 - 1,
- (static_cast<double>(a) + 128) / 127.5 - 1);
- }
- void glColor4dv(GLdouble const* v)
- {
- g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
- }
- void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
- {
- g_gl_context->gl_color(r, g, b, a);
- }
- void glColor4fv(GLfloat const* v)
- {
- g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
- }
- void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
- {
- g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
- }
- void glColor4ubv(GLubyte const* v)
- {
- g_gl_context->gl_color(v[0] / 255.0, v[1] / 255.0, v[2] / 255.0, v[3] / 255.0);
- }
- void glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
- {
- g_gl_context->gl_color_mask(red, green, blue, alpha);
- }
- void glColorMaterial(GLenum face, GLenum mode)
- {
- g_gl_context->gl_color_material(face, mode);
- }
- void glColorPointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
- {
- g_gl_context->gl_color_pointer(size, type, stride, pointer);
- }
- void glCompileShader(GLuint shader)
- {
- g_gl_context->gl_compile_shader(shader);
- }
- void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
- {
- g_gl_context->gl_copy_tex_image_2d(target, level, internalformat, x, y, width, height, border);
- }
- void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
- {
- g_gl_context->gl_copy_tex_sub_image_2d(target, level, xoffset, yoffset, x, y, width, height);
- }
- GLuint glCreateProgram()
- {
- return g_gl_context->gl_create_program();
- }
- GLuint glCreateShader(GLenum shader_type)
- {
- return g_gl_context->gl_create_shader(shader_type);
- }
- void glCullFace(GLenum mode)
- {
- g_gl_context->gl_cull_face(mode);
- }
- void glDeleteBuffers(GLsizei n, GLuint const* buffers)
- {
- g_gl_context->gl_delete_buffers(n, buffers);
- }
- void glDepthFunc(GLenum func)
- {
- g_gl_context->gl_depth_func(func);
- }
- void glDepthMask(GLboolean flag)
- {
- g_gl_context->gl_depth_mask(flag);
- }
- void glDepthRange(GLdouble min, GLdouble max)
- {
- g_gl_context->gl_depth_range(min, max);
- }
- void glDeleteLists(GLuint list, GLsizei range)
- {
- return g_gl_context->gl_delete_lists(list, range);
- }
- void glDeleteProgram(GLuint program)
- {
- g_gl_context->gl_delete_program(program);
- }
- void glDeleteShader(GLuint shader)
- {
- g_gl_context->gl_delete_shader(shader);
- }
- void glDeleteTextures(GLsizei n, GLuint const* textures)
- {
- g_gl_context->gl_delete_textures(n, textures);
- }
- void glDisable(GLenum cap)
- {
- g_gl_context->gl_disable(cap);
- }
- void glDisableClientState(GLenum cap)
- {
- g_gl_context->gl_disable_client_state(cap);
- }
- void glDrawArrays(GLenum mode, GLint first, GLsizei count)
- {
- g_gl_context->gl_draw_arrays(mode, first, count);
- }
- void glDrawBuffer(GLenum buffer)
- {
- g_gl_context->gl_draw_buffer(buffer);
- }
- void glDrawElements(GLenum mode, GLsizei count, GLenum type, void const* indices)
- {
- g_gl_context->gl_draw_elements(mode, count, type, indices);
- }
- void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, void const* data)
- {
- g_gl_context->gl_draw_pixels(width, height, format, type, data);
- }
- void glEnable(GLenum cap)
- {
- g_gl_context->gl_enable(cap);
- }
- void glEnableClientState(GLenum cap)
- {
- g_gl_context->gl_enable_client_state(cap);
- }
- void glEnd()
- {
- g_gl_context->gl_end();
- }
- void glEndList(void)
- {
- return g_gl_context->gl_end_list();
- }
- void glEvalCoord1d(GLdouble u)
- {
- dbgln("glEvalCoord1d({}): unimplemented", u);
- TODO();
- }
- void glEvalCoord1f(GLfloat u)
- {
- dbgln("glEvalCoord1f({}): unimplemented", u);
- TODO();
- }
- void glEvalCoord2d(GLdouble u, GLdouble v)
- {
- dbgln("glEvalCoord2d({}, {}): unimplemented", u, v);
- TODO();
- }
- void glEvalCoord2f(GLfloat u, GLfloat v)
- {
- dbgln("glEvalCoord2f({}, {}): unimplemented", u, v);
- TODO();
- }
- void glEvalMesh1(GLenum mode, GLint i1, GLint i2)
- {
- dbgln("glEvalMesh1({:#x}, {}, {}): unimplemented", mode, i1, i2);
- TODO();
- }
- void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
- {
- dbgln("glEvalMesh2({:#x}, {}, {}, {}, {}): unimplemented", mode, i1, i2, j1, j2);
- TODO();
- }
- void glEvalPoint1(GLint i)
- {
- dbgln("glEvalPoint1({}): unimplemented", i);
- TODO();
- }
- void glEvalPoint2(GLint i, GLint j)
- {
- dbgln("glEvalPoint2({}, {}): unimplemented", i, j);
- TODO();
- }
- void glFinish()
- {
- g_gl_context->gl_finish();
- }
- void glFogfv(GLenum pname, GLfloat const* params)
- {
- g_gl_context->gl_fogfv(pname, params);
- }
- void glFogf(GLenum pname, GLfloat param)
- {
- g_gl_context->gl_fogf(pname, param);
- }
- void glFogi(GLenum pname, GLint param)
- {
- g_gl_context->gl_fogi(pname, param);
- }
- void glFlush()
- {
- g_gl_context->gl_flush();
- }
- void glFrontFace(GLenum mode)
- {
- g_gl_context->gl_front_face(mode);
- }
- void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal)
- {
- g_gl_context->gl_frustum(left, right, bottom, top, nearVal, farVal);
- }
- void glGenBuffers(GLsizei n, GLuint* buffers)
- {
- g_gl_context->gl_gen_buffers(n, buffers);
- }
- GLuint glGenLists(GLsizei range)
- {
- return g_gl_context->gl_gen_lists(range);
- }
- void glGenTextures(GLsizei n, GLuint* textures)
- {
- g_gl_context->gl_gen_textures(n, textures);
- }
- void glGetBooleanv(GLenum pname, GLboolean* data)
- {
- g_gl_context->gl_get_booleanv(pname, data);
- }
- void glGetClipPlane(GLenum plane, GLdouble* equation)
- {
- g_gl_context->gl_get_clip_plane(plane, equation);
- }
- void glGetDoublev(GLenum pname, GLdouble* params)
- {
- g_gl_context->gl_get_doublev(pname, params);
- }
- GLenum glGetError()
- {
- return g_gl_context->gl_get_error();
- }
- void glGetFloatv(GLenum pname, GLfloat* params)
- {
- g_gl_context->gl_get_floatv(pname, params);
- }
- void glGetIntegerv(GLenum pname, GLint* data)
- {
- g_gl_context->gl_get_integerv(pname, data);
- }
- void glGetLightfv(GLenum light, GLenum pname, GLfloat* params)
- {
- g_gl_context->gl_get_light(light, pname, params, GL_FLOAT);
- }
- void glGetLightiv(GLenum light, GLenum pname, GLint* params)
- {
- g_gl_context->gl_get_light(light, pname, params, GL_INT);
- }
- void glGetMaterialfv(GLenum face, GLenum pname, GLfloat* params)
- {
- g_gl_context->gl_get_material(face, pname, params, GL_FLOAT);
- }
- void glGetMaterialiv(GLenum face, GLenum pname, GLint* params)
- {
- g_gl_context->gl_get_material(face, pname, params, GL_INT);
- }
- GLubyte const* glGetString(GLenum name)
- {
- return g_gl_context->gl_get_string(name);
- }
- void glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, void* pixels)
- {
- g_gl_context->gl_get_tex_image(target, level, format, type, pixels);
- }
- void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
- {
- g_gl_context->gl_get_tex_parameter_integerv(target, level, pname, params);
- }
- void glHint(GLenum target, GLenum mode)
- {
- g_gl_context->gl_hint(target, mode);
- }
- GLboolean glIsEnabled(GLenum cap)
- {
- return g_gl_context->gl_is_enabled(cap);
- }
- GLboolean glIsList(GLuint list)
- {
- return g_gl_context->gl_is_list(list);
- }
- GLboolean glIsTexture(GLuint texture)
- {
- return g_gl_context->gl_is_texture(texture);
- }
- void glLightf(GLenum light, GLenum pname, GLfloat param)
- {
- g_gl_context->gl_lightf(light, pname, param);
- }
- void glLightfv(GLenum light, GLenum pname, GLfloat const* param)
- {
- g_gl_context->gl_lightfv(light, pname, param);
- }
- void glLighti(GLenum light, GLenum pname, GLint param)
- {
- g_gl_context->gl_lightf(light, pname, param);
- }
- void glLightiv(GLenum light, GLenum pname, GLint const* params)
- {
- g_gl_context->gl_lightiv(light, pname, params);
- }
- void glLightModelf(GLenum pname, GLfloat param)
- {
- g_gl_context->gl_light_model(pname, param, 0.0f, 0.0f, 0.0f);
- }
- void glLightModelfv(GLenum pname, GLfloat const* params)
- {
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- g_gl_context->gl_light_model(pname, params[0], params[1], params[2], params[3]);
- break;
- default:
- g_gl_context->gl_light_model(pname, params[0], 0.0f, 0.0f, 0.0f);
- break;
- }
- }
- void glLightModeliv(GLenum pname, GLint const* params)
- {
- switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT:
- g_gl_context->gl_light_model(pname, params[0], params[1], params[2], params[3]);
- break;
- default:
- g_gl_context->gl_light_model(pname, params[0], 0.0f, 0.0f, 0.0f);
- break;
- }
- }
- void glLightModeli(GLenum pname, GLint param)
- {
- g_gl_context->gl_light_model(pname, param, 0.0f, 0.0f, 0.0f);
- }
- void glLineWidth(GLfloat width)
- {
- g_gl_context->gl_line_width(width);
- }
- void glLinkProgram(GLuint program)
- {
- g_gl_context->gl_link_program(program);
- }
- void glListBase(GLuint base)
- {
- return g_gl_context->gl_list_base(base);
- }
- void glLoadIdentity()
- {
- g_gl_context->gl_load_identity();
- }
- void glLoadMatrixd(GLdouble const* matrix)
- {
- g_gl_context->gl_load_matrix(transpose_input_matrix<double, float>(matrix));
- }
- void glLoadMatrixf(GLfloat const* matrix)
- {
- g_gl_context->gl_load_matrix(transpose_input_matrix<float, float>(matrix));
- }
- void glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, GLdouble const* points)
- {
- dbgln("glMap1d({:#x}, {}, {}, {}, {}, {:p}): unimplemented", target, u1, u2, stride, order, points);
- TODO();
- }
- void glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, GLfloat const* points)
- {
- dbgln("glMap1f({:#x}, {}, {}, {}, {}, {:p}): unimplemented", target, u1, u2, stride, order, points);
- TODO();
- }
- void glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble const* points)
- {
- dbgln("glMap2d({:#x}, {}, {}, {}, {}, {}, {}, {}, {}, {:p}): unimplemented", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
- TODO();
- }
- void glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat const* points)
- {
- dbgln("glMap2f({:#x}, {}, {}, {}, {}, {}, {}, {}, {}, {:p}): unimplemented", target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
- TODO();
- }
- void glMapGrid1d(GLint un, GLdouble u1, GLdouble u2)
- {
- dbgln("glMapGrid1d({}, {}, {}): unimplemented", un, u1, u2);
- TODO();
- }
- void glMapGrid1f(GLint un, GLfloat u1, GLfloat u2)
- {
- dbgln("glMapGrid1f({}, {}, {}): unimplemented", un, u1, u2);
- TODO();
- }
- void glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
- {
- dbgln("glMapGrid2d({}, {}, {}, {}, {}, {}): unimplemented", un, u1, u2, vn, v1, v2);
- TODO();
- }
- void glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
- {
- dbgln("glMapGrid2f({}, {}, {}, {}, {}, {}): unimplemented", un, u1, u2, vn, v1, v2);
- TODO();
- }
- void glMaterialf(GLenum face, GLenum pname, GLfloat param)
- {
- g_gl_context->gl_materialf(face, pname, param);
- }
- void glMaterialfv(GLenum face, GLenum pname, GLfloat const* params)
- {
- g_gl_context->gl_materialfv(face, pname, params);
- }
- void glMateriali(GLenum face, GLenum pname, GLint param)
- {
- g_gl_context->gl_materialf(face, pname, param);
- }
- void glMaterialiv(GLenum face, GLenum pname, GLint const* params)
- {
- g_gl_context->gl_materialiv(face, pname, params);
- }
- void glMatrixMode(GLenum mode)
- {
- g_gl_context->gl_matrix_mode(mode);
- }
- void glMultiTexCoord1f(GLenum target, GLfloat s)
- {
- g_gl_context->gl_multi_tex_coord(target, s, 0.f, 0.f, 1.f);
- }
- void glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
- {
- glMultiTexCoord2f(target, s, t);
- }
- void glMultiTexCoord2fvARB(GLenum target, GLfloat const* v)
- {
- glMultiTexCoord2fv(target, v);
- }
- void glMultiTexCoord2fv(GLenum target, GLfloat const* v)
- {
- g_gl_context->gl_multi_tex_coord(target, v[0], v[1], 0.f, 1.f);
- }
- void glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t)
- {
- g_gl_context->gl_multi_tex_coord(target, s, t, 0.f, 1.f);
- }
- void glMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r)
- {
- g_gl_context->gl_multi_tex_coord(target, s, t, r, 1.f);
- }
- void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
- {
- g_gl_context->gl_multi_tex_coord(target, s, t, r, q);
- }
- void glMultMatrixd(GLdouble const* matrix)
- {
- g_gl_context->gl_mult_matrix(transpose_input_matrix<double, float>(matrix));
- }
- void glMultMatrixf(GLfloat const* matrix)
- {
- g_gl_context->gl_mult_matrix(transpose_input_matrix<float, float>(matrix));
- }
- void glNewList(GLuint list, GLenum mode)
- {
- return g_gl_context->gl_new_list(list, mode);
- }
- void glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz)
- {
- g_gl_context->gl_normal(nx, ny, nz);
- }
- void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz)
- {
- g_gl_context->gl_normal(nx, ny, nz);
- }
- void glNormal3fv(GLfloat const* v)
- {
- g_gl_context->gl_normal(v[0], v[1], v[2]);
- }
- void glNormalPointer(GLenum type, GLsizei stride, void const* pointer)
- {
- g_gl_context->gl_normal_pointer(type, stride, pointer);
- }
- void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal)
- {
- g_gl_context->gl_ortho(left, right, bottom, top, nearVal, farVal);
- }
- void glPixelStorei(GLenum pname, GLint param)
- {
- g_gl_context->gl_pixel_storei(pname, param);
- }
- void glPointSize(GLfloat size)
- {
- g_gl_context->gl_point_size(size);
- }
- void glPolygonMode(GLenum face, GLenum mode)
- {
- g_gl_context->gl_polygon_mode(face, mode);
- }
- void glPolygonOffset(GLfloat factor, GLfloat units)
- {
- g_gl_context->gl_polygon_offset(factor, units);
- }
- void glPopAttrib()
- {
- g_gl_context->gl_pop_attrib();
- }
- void glPopMatrix()
- {
- g_gl_context->gl_pop_matrix();
- }
- void glPushAttrib(GLbitfield mask)
- {
- g_gl_context->gl_push_attrib(mask);
- }
- void glPushMatrix()
- {
- g_gl_context->gl_push_matrix();
- }
- void glRasterPos2d(GLdouble x, GLdouble y)
- {
- g_gl_context->gl_raster_pos(static_cast<float>(x), static_cast<float>(y), 0.f, 1.f);
- }
- void glRasterPos2f(GLfloat x, GLfloat y)
- {
- g_gl_context->gl_raster_pos(x, y, 0.f, 1.f);
- }
- void glRasterPos2i(GLint x, GLint y)
- {
- g_gl_context->gl_raster_pos(static_cast<float>(x), static_cast<float>(y), 0.f, 1.f);
- }
- void glRasterPos2s(GLshort x, GLshort y)
- {
- g_gl_context->gl_raster_pos(static_cast<float>(x), static_cast<float>(y), 0.f, 1.f);
- }
- void glReadBuffer(GLenum mode)
- {
- g_gl_context->gl_read_buffer(mode);
- }
- void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
- {
- g_gl_context->gl_read_pixels(x, y, width, height, format, type, pixels);
- }
- void glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
- {
- g_gl_context->gl_rect(x1, y1, x2, y2);
- }
- void glRecti(GLint x1, GLint y1, GLint x2, GLint y2)
- {
- g_gl_context->gl_rect(x1, y1, x2, y2);
- }
- void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
- {
- g_gl_context->gl_rotate(angle, x, y, z);
- }
- void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
- {
- g_gl_context->gl_rotate(angle, x, y, z);
- }
- void glScaled(GLdouble x, GLdouble y, GLdouble z)
- {
- g_gl_context->gl_scale(x, y, z);
- }
- void glScalef(GLfloat x, GLfloat y, GLfloat z)
- {
- g_gl_context->gl_scale(x, y, z);
- }
- void glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
- {
- g_gl_context->gl_scissor(x, y, width, height);
- }
- void glShadeModel(GLenum mode)
- {
- g_gl_context->gl_shade_model(mode);
- }
- void glShaderSource(GLuint shader, GLsizei count, GLchar const** string, GLint const* length)
- {
- g_gl_context->gl_shader_source(shader, count, string, length);
- }
- void glStencilFunc(GLenum func, GLint ref, GLuint mask)
- {
- g_gl_context->gl_stencil_func_separate(GL_FRONT_AND_BACK, func, ref, mask);
- }
- void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
- {
- g_gl_context->gl_stencil_func_separate(face, func, ref, mask);
- }
- void glStencilMask(GLuint mask)
- {
- g_gl_context->gl_stencil_mask_separate(GL_FRONT_AND_BACK, mask);
- }
- void glStencilMaskSeparate(GLenum face, GLuint mask)
- {
- g_gl_context->gl_stencil_mask_separate(face, mask);
- }
- void glStencilOp(GLenum sfail, GLenum dpfail, GLenum dppass)
- {
- g_gl_context->gl_stencil_op_separate(GL_FRONT_AND_BACK, sfail, dpfail, dppass);
- }
- void glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass)
- {
- g_gl_context->gl_stencil_op_separate(face, sfail, dpfail, dppass);
- }
- void glTexCoord1f(GLfloat s)
- {
- g_gl_context->gl_tex_coord(s, 0.0f, 0.0f, 1.0f);
- }
- void glTexCoord1fv(GLfloat const* v)
- {
- g_gl_context->gl_tex_coord(v[0], 0.0f, 0.0f, 1.0f);
- }
- void glTexCoord2d(GLdouble s, GLdouble t)
- {
- g_gl_context->gl_tex_coord(s, t, 0.0f, 1.0f);
- }
- void glTexCoord2dv(GLdouble const* v)
- {
- g_gl_context->gl_tex_coord(v[0], v[1], 0.0f, 1.0f);
- }
- void glTexCoord2f(GLfloat s, GLfloat t)
- {
- g_gl_context->gl_tex_coord(s, t, 0.0f, 1.0f);
- }
- void glTexCoord2fv(GLfloat const* v)
- {
- g_gl_context->gl_tex_coord(v[0], v[1], 0.0f, 1.0f);
- }
- void glTexCoord2i(GLint s, GLint t)
- {
- g_gl_context->gl_tex_coord(s, t, 0.0f, 1.0f);
- }
- void glTexCoord3f(GLfloat s, GLfloat t, GLfloat r)
- {
- g_gl_context->gl_tex_coord(s, t, r, 1.0f);
- }
- void glTexCoord3fv(GLfloat const* v)
- {
- g_gl_context->gl_tex_coord(v[0], v[1], v[2], 1.0f);
- }
- void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
- {
- g_gl_context->gl_tex_coord(s, t, r, q);
- }
- void glTexCoord4fv(GLfloat const* v)
- {
- g_gl_context->gl_tex_coord(v[0], v[1], v[2], v[3]);
- }
- void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
- {
- g_gl_context->gl_tex_coord_pointer(size, type, stride, pointer);
- }
- void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
- {
- g_gl_context->gl_tex_env(target, pname, param);
- }
- void glTexEnvi(GLenum target, GLenum pname, GLint param)
- {
- g_gl_context->gl_tex_env(target, pname, param);
- }
- void glTexGend(GLenum coord, GLenum pname, GLdouble param)
- {
- g_gl_context->gl_tex_gen(coord, pname, param);
- }
- void glTexGenf(GLenum coord, GLenum pname, GLfloat param)
- {
- g_gl_context->gl_tex_gen(coord, pname, param);
- }
- void glTexGenfv(GLenum coord, GLenum pname, GLfloat const* params)
- {
- g_gl_context->gl_tex_gen_floatv(coord, pname, params);
- }
- void glTexGeni(GLenum coord, GLenum pname, GLint param)
- {
- g_gl_context->gl_tex_gen(coord, pname, param);
- }
- void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, GLvoid const* data)
- {
- dbgln("glTexImage1D({:#x}, {}, {:#x}, {}, {}, {:#x}, {:#x}, {:p}): unimplemented", target, level, internalFormat, width, border, format, type, data);
- TODO();
- }
- void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid const* data)
- {
- g_gl_context->gl_tex_image_2d(target, level, internalFormat, width, height, border, format, type, data);
- }
- void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid const* data)
- {
- dbgln("glTexImage3D({:#x}, {}, {:#x}, {}, {}, {}, {}, {:#x}, {:#x}, {:p}): unimplemented", target, level, internalFormat, width, height, depth, border, format, type, data);
- TODO();
- }
- void glTexParameteri(GLenum target, GLenum pname, GLint param)
- {
- g_gl_context->gl_tex_parameter(target, pname, param);
- }
- void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
- {
- g_gl_context->gl_tex_parameter(target, pname, param);
- }
- void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid const* data)
- {
- g_gl_context->gl_tex_sub_image_2d(target, level, xoffset, yoffset, width, height, format, type, data);
- }
- void glTranslated(GLdouble x, GLdouble y, GLdouble z)
- {
- g_gl_context->gl_translate(x, y, z);
- }
- void glTranslatef(GLfloat x, GLfloat y, GLfloat z)
- {
- g_gl_context->gl_translate(x, y, z);
- }
- void glUseProgram(GLuint program)
- {
- g_gl_context->gl_use_program(program);
- }
- void glVertex2d(GLdouble x, GLdouble y)
- {
- g_gl_context->gl_vertex(x, y, 0.0, 1.0);
- }
- void glVertex2dv(GLdouble const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
- }
- void glVertex2f(GLfloat x, GLfloat y)
- {
- g_gl_context->gl_vertex(x, y, 0.0, 1.0);
- }
- void glVertex2fv(GLfloat const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
- }
- void glVertex2i(GLint x, GLint y)
- {
- g_gl_context->gl_vertex(x, y, 0.0, 1.0);
- }
- void glVertex2iv(GLint const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
- }
- void glVertex2s(GLshort x, GLshort y)
- {
- g_gl_context->gl_vertex(x, y, 0.0, 1.0);
- }
- void glVertex2sv(GLshort const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], 0.0, 1.0);
- }
- void glVertex3d(GLdouble x, GLdouble y, GLdouble z)
- {
- g_gl_context->gl_vertex(x, y, z, 1.0);
- }
- void glVertex3dv(GLdouble const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
- }
- void glVertex3f(GLfloat x, GLfloat y, GLfloat z)
- {
- g_gl_context->gl_vertex(x, y, z, 1.0);
- }
- void glVertex3fv(GLfloat const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
- }
- void glVertex3i(GLint x, GLint y, GLint z)
- {
- g_gl_context->gl_vertex(x, y, z, 1.0);
- }
- void glVertex3iv(GLint const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
- }
- void glVertex3s(GLshort x, GLshort y, GLshort z)
- {
- g_gl_context->gl_vertex(x, y, z, 1.0);
- }
- void glVertex3sv(GLshort const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], 1.0);
- }
- void glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
- {
- g_gl_context->gl_vertex(x, y, z, w);
- }
- void glVertex4dv(GLdouble const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
- }
- void glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
- {
- g_gl_context->gl_vertex(x, y, z, w);
- }
- void glVertex4fv(GLfloat const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
- }
- void glVertex4i(GLint x, GLint y, GLint z, GLint w)
- {
- g_gl_context->gl_vertex(x, y, z, w);
- }
- void glVertex4iv(GLint const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
- }
- void glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
- {
- g_gl_context->gl_vertex(x, y, z, w);
- }
- void glVertex4sv(GLshort const* v)
- {
- g_gl_context->gl_vertex(v[0], v[1], v[2], v[3]);
- }
- void glVertexPointer(GLint size, GLenum type, GLsizei stride, void const* pointer)
- {
- g_gl_context->gl_vertex_pointer(size, type, stride, pointer);
- }
- void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
- {
- g_gl_context->gl_viewport(x, y, width, height);
- }
|