]> gitweb.factorcode.org Git - factor.git/commitdiff
Add: OpenGL 4+ extensions and demos for them
authorSebastian Strobl <sebastian@strobl.net>
Sat, 16 Sep 2023 05:46:39 +0000 (07:46 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 16 Sep 2023 16:27:07 +0000 (09:27 -0700)
18 files changed:
basis/opengl/authors.txt
basis/opengl/gl/authors.txt
basis/opengl/gl/gl.factor
basis/opengl/opengl-docs.factor
basis/opengl/opengl.factor
basis/opengl/shaders/authors.txt
basis/opengl/shaders/shaders-docs.factor
basis/opengl/shaders/shaders.factor
basis/opengl/textures/textures-docs.factor
basis/opengl/textures/textures.factor
extra/glfw/authors.txt [new file with mode: 0644]
extra/glfw/ffi/authors.txt [new file with mode: 0644]
extra/opengl/demos/authors.txt [new file with mode: 0644]
extra/opengl/demos/compute/authors.txt [new file with mode: 0644]
extra/opengl/demos/compute/compute.factor [new file with mode: 0644]
extra/opengl/demos/demos.factor [new file with mode: 0644]
extra/opengl/demos/gl4/authors.txt [new file with mode: 0644]
extra/opengl/demos/gl4/gl4.factor [new file with mode: 0644]

index f4e25322b8837d0e372b21d2d236b93c349ff615..c7698c0dde995dadda936c662f5b0cdbec02d791 100644 (file)
@@ -2,3 +2,4 @@ Slava Pestov
 Eduardo Cavazos
 Joe Groff
 Alex Chapman
+Sebastian Strobl
index e9c193bac72836f0710fc5440af248256e9fc736..bf3fa6986d594bdce3eda759973bbb17bd983a54 100644 (file)
@@ -1 +1,2 @@
 Alex Chapman
+Sebastian Strobl
index 9c1d0feb08beed1380c07dd45fdf3591d5c05bec..13367ea905ea5865b09d14d8db89873d09cc7bd9 100644 (file)
@@ -2568,3 +2568,240 @@ CONSTANT: GL_COMPRESSED_LUMINANCE_LATC1_EXT              0x8C70
 CONSTANT: GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT       0x8C71
 CONSTANT: GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT        0x8C72
 CONSTANT: GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
+
+! OpenGL 4.1
+
+! GL_ARB_separate_shader_objects
+
+GL-FUNCTION: void glProgramUniform1f { } ( GLuint program, GLint location, GLfloat v0 )
+GL-FUNCTION: void glProgramUniform2f { } ( GLuint program, GLint location, GLfloat v0, GLfloat v1 )
+GL-FUNCTION: void glProgramUniform3f { } ( GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2 )
+GL-FUNCTION: void glProgramUniform4f { } ( GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3 )
+GL-FUNCTION: void glProgramUniform1i { } ( GLuint program, GLint location, GLint v0 )
+GL-FUNCTION: void glProgramUniform2i { } ( GLuint program, GLint location, GLint v0, GLint v1 )
+GL-FUNCTION: void glProgramUniform3i { } ( GLuint program, GLint location, GLint v0, GLint v1, GLint v2 )
+GL-FUNCTION: void glProgramUniform4i { } ( GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3 )
+GL-FUNCTION: void glProgramUniform1ui { } ( GLuint program, GLint location, GLuint v0 )
+GL-FUNCTION: void glProgramUniform2ui { } ( GLuint program, GLint location, GLuint v0, GLuint v1 )
+GL-FUNCTION: void glProgramUniform3ui { } ( GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2 )
+GL-FUNCTION: void glProgramUniform4ui { } ( GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 )
+GL-FUNCTION: void glProgramUniform1fv { } ( GLuint program, GLint location, GLsizei count, GLfloat *value )
+GL-FUNCTION: void glProgramUniform2fv { } ( GLuint program, GLint location, GLsizei count, GLfloat *value )
+GL-FUNCTION: void glProgramUniform3fv { } ( GLuint program, GLint location, GLsizei count, GLfloat *value )
+GL-FUNCTION: void glProgramUniform4fv { } ( GLuint program, GLint location, GLsizei count, GLfloat *value )
+GL-FUNCTION: void glProgramUniform1iv { } ( GLuint program, GLint location, GLsizei count, GLint *value )
+GL-FUNCTION: void glProgramUniform2iv { } ( GLuint program, GLint location, GLsizei count, GLint *value )
+GL-FUNCTION: void glProgramUniform3iv { } ( GLuint program, GLint location, GLsizei count, GLint *value )
+GL-FUNCTION: void glProgramUniform4iv { } ( GLuint program, GLint location, GLsizei count, GLint *value )
+GL-FUNCTION: void glProgramUniform1uiv { } ( GLuint program, GLint location, GLsizei count, GLuint *value )
+GL-FUNCTION: void glProgramUniform2uiv { } ( GLuint program, GLint location, GLsizei count, GLuint *value )
+GL-FUNCTION: void glProgramUniform3uiv { } ( GLuint program, GLint location, GLsizei count, GLuint *value )
+GL-FUNCTION: void glProgramUniform4uiv { } ( GLuint program, GLint location, GLsizei count, GLuint *value )
+GL-FUNCTION: void glProgramUniformMatrix2fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix3fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix4fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix2x3fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix3x2fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix2x4fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix4x2fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix3x4fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+GL-FUNCTION: void glProgramUniformMatrix4x3fv { } ( GLuint program, GLint location, GLsizei count, GLboolean transpose, GLfloat *value )
+
+! OpenGL 4.2
+
+! GL_ARB_shader_image_load_store
+
+CONSTANT: GL_MAX_IMAGE_UNITS                                 0x8F38
+CONSTANT: GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS   0x8F39
+CONSTANT: GL_MAX_IMAGE_SAMPLES                               0x906D
+CONSTANT: GL_MAX_VERTEX_IMAGE_UNIFORMS                       0x90CA
+CONSTANT: GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS                 0x90CB
+CONSTANT: GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS              0x90CC
+CONSTANT: GL_MAX_GEOMETRY_IMAGE_UNIFORMS                     0x90CD
+CONSTANT: GL_MAX_FRAGMENT_IMAGE_UNIFORMS                     0x90CE
+CONSTANT: GL_MAX_COMBINED_IMAGE_UNIFORMS                     0x90CF
+CONSTANT: GL_IMAGE_BINDING_NAME                              0x8F3A
+CONSTANT: GL_IMAGE_BINDING_LEVEL                             0x8F3B
+CONSTANT: GL_IMAGE_BINDING_LAYERED                           0x8F3C
+CONSTANT: GL_IMAGE_BINDING_LAYER                             0x8F3D
+CONSTANT: GL_IMAGE_BINDING_ACCESS                            0x8F3E
+CONSTANT: GL_IMAGE_BINDING_FORMAT                            0x906E
+CONSTANT: GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT                 0x00000001
+CONSTANT: GL_ELEMENT_ARRAY_BARRIER_BIT                       0x00000002
+CONSTANT: GL_UNIFORM_BARRIER_BIT                             0x00000004
+CONSTANT: GL_TEXTURE_FETCH_BARRIER_BIT                       0x00000008
+CONSTANT: GL_SHADER_IMAGE_ACCESS_BARRIER_BIT                 0x00000020
+CONSTANT: GL_COMMAND_BARRIER_BIT                             0x00000040
+CONSTANT: GL_PIXEL_BUFFER_BARRIER_BIT                        0x00000080
+CONSTANT: GL_TEXTURE_UPDATE_BARRIER_BIT                      0x00000100
+CONSTANT: GL_BUFFER_UPDATE_BARRIER_BIT                       0x00000200
+CONSTANT: GL_FRAMEBUFFER_BARRIER_BIT                         0x00000400
+CONSTANT: GL_TRANSFORM_FEEDBACK_BARRIER_BIT                  0x00000800
+CONSTANT: GL_ATOMIC_COUNTER_BARRIER_BIT                      0x00001000
+CONSTANT: GL_ALL_BARRIER_BITS                                0xFFFFFFFF
+CONSTANT: GL_IMAGE_1D                                        0x904C
+CONSTANT: GL_IMAGE_2D                                        0x904D
+CONSTANT: GL_IMAGE_3D                                        0x904E
+CONSTANT: GL_IMAGE_2D_RECT                                   0x904F
+CONSTANT: GL_IMAGE_CUBE                                      0x9050
+CONSTANT: GL_IMAGE_BUFFER                                    0x9051
+CONSTANT: GL_IMAGE_1D_ARRAY                                  0x9052
+CONSTANT: GL_IMAGE_2D_ARRAY                                  0x9053
+CONSTANT: GL_IMAGE_CUBE_MAP_ARRAY                            0x9054
+CONSTANT: GL_IMAGE_2D_MULTISAMPLE                            0x9055
+CONSTANT: GL_IMAGE_2D_MULTISAMPLE_ARRAY                      0x9056
+CONSTANT: GL_INT_IMAGE_1D                                    0x9057
+CONSTANT: GL_INT_IMAGE_2D                                    0x9058
+CONSTANT: GL_INT_IMAGE_3D                                    0x9059
+CONSTANT: GL_INT_IMAGE_2D_RECT                               0x905A
+CONSTANT: GL_INT_IMAGE_CUBE                                  0x905B
+CONSTANT: GL_INT_IMAGE_BUFFER                                0x905C
+CONSTANT: GL_INT_IMAGE_1D_ARRAY                              0x905D
+CONSTANT: GL_INT_IMAGE_2D_ARRAY                              0x905E
+CONSTANT: GL_INT_IMAGE_CUBE_MAP_ARRAY                        0x905F
+CONSTANT: GL_INT_IMAGE_2D_MULTISAMPLE                        0x9060
+CONSTANT: GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY                  0x9061
+CONSTANT: GL_UNSIGNED_INT_IMAGE_1D                           0x9062
+CONSTANT: GL_UNSIGNED_INT_IMAGE_2D                           0x9063
+CONSTANT: GL_UNSIGNED_INT_IMAGE_3D                           0x9064
+CONSTANT: GL_UNSIGNED_INT_IMAGE_2D_RECT                      0x9065
+CONSTANT: GL_UNSIGNED_INT_IMAGE_CUBE                         0x9066
+CONSTANT: GL_UNSIGNED_INT_IMAGE_BUFFER                       0x9067
+CONSTANT: GL_UNSIGNED_INT_IMAGE_1D_ARRAY                     0x9068
+CONSTANT: GL_UNSIGNED_INT_IMAGE_2D_ARRAY                     0x9069
+CONSTANT: GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY               0x906A
+CONSTANT: GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE               0x906B
+CONSTANT: GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY         0x906C
+CONSTANT: GL_IMAGE_FORMAT_COMPATIBILITY_TYPE                 0x90C7
+CONSTANT: GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE              0x90C8
+CONSTANT: GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS             0x90C9
+GL-FUNCTION: void glMemoryBarrier { } ( GLbitfield barriers )
+
+
+! GL_OES_EGL_image_external_essl3
+
+GL-FUNCTION: void glBindImageTexture { } ( GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format )
+
+! OpenGL 4.3
+
+! GL_ARB_compute_shader
+
+CONSTANT: GL_MAX_COMPUTE_UNIFORM_BLOCKS                         0x91BB
+CONSTANT: GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS                    0x91BC
+CONSTANT: GL_MAX_COMPUTE_IMAGE_UNIFORMS                         0x91BD
+CONSTANT: GL_MAX_COMPUTE_SHARED_MEMORY_SIZE                     0x8262
+CONSTANT: GL_MAX_COMPUTE_UNIFORM_COMPONENTS                     0x8263
+CONSTANT: GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS                 0x8264
+CONSTANT: GL_MAX_COMPUTE_ATOMIC_COUNTERS                        0x8265
+CONSTANT: GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS            0x8266
+CONSTANT: GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS                 0x90EB
+CONSTANT: GL_MAX_COMPUTE_WORK_GROUP_COUNT                       0x91BE
+CONSTANT: GL_MAX_COMPUTE_WORK_GROUP_SIZE                        0x91BF
+CONSTANT: GL_COMPUTE_WORK_GROUP_SIZE                            0x8267
+CONSTANT: GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER         0x90EC
+CONSTANT: GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED
+CONSTANT: GL_DISPATCH_INDIRECT_BUFFER                           0x90EE
+CONSTANT: GL_DISPATCH_INDIRECT_BUFFER_BINDING                   0x90EF
+CONSTANT: GL_COMPUTE_SHADER                                     0x91B9
+CONSTANT: GL_COMPUTE_SHADER_BIT                                 0x00000020
+
+GL-FUNCTION: void glDispatchCompute { } ( GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z )
+GL-FUNCTION: void glDispatchComputeIndirect { } ( GLintptr indirect )
+
+! OpenGL 4.5
+
+!  GL_ARB_direct_state_access
+
+GL-FUNCTION: void glCreateTransformFeedbacks { } ( GLsizei n, GLuint *ids )
+GL-FUNCTION: void glTransformFeedbackBufferBase { } ( GLuint xfb, GLuint index, GLuint buffer )
+GL-FUNCTION: void glTransformFeedbackBufferRange { } ( GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size )
+GL-FUNCTION: void glGetTransformFeedbackiv { } ( GLuint xfb, GLenum pname, GLint *param )
+GL-FUNCTION: void glGetTransformFeedbacki_v { } ( GLuint xfb, GLenum pname, GLuint index, GLint *param )
+GL-FUNCTION: void glGetTransformFeedbacki64_v { } ( GLuint xfb, GLenum pname, GLuint index, GLint64 *param )
+GL-FUNCTION: void glCreateBuffers { } ( GLsizei n, GLuint *buffers )
+GL-FUNCTION: void glNamedBufferStorage { } ( GLuint buffer, GLsizeiptr size, void *data, GLbitfield flags )
+GL-FUNCTION: void glNamedBufferData { } ( GLuint buffer, GLsizeiptr size, void *data, GLenum usage )
+GL-FUNCTION: GLenum glCheckNamedFramebufferStatus { } ( GLuint framebuffer, GLenum target )
+GL-FUNCTION: GLboolean glUnmapNamedBuffer { } ( GLuint buffer )
+GL-FUNCTION: void glNamedBufferSubData { } ( GLuint buffer, GLintptr offset, GLsizeiptr size, void *data )
+GL-FUNCTION: void glCopyNamedBufferSubData { } ( GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size )
+GL-FUNCTION: void glClearNamedBufferData { } ( GLuint buffer, GLenum internalformat, GLenum format, GLenum type, void *data )
+GL-FUNCTION: void glClearNamedBufferSubData { } ( GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, void *data )
+GL-FUNCTION: void* glMapNamedBuffer { } ( GLuint buffer, GLenum access )
+GL-FUNCTION: void* glMapNamedBufferRange { } ( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access )
+GL-FUNCTION: void glFlushMappedNamedBufferRange { } ( GLuint buffer, GLintptr offset, GLsizeiptr length )
+GL-FUNCTION: void glGetNamedBufferParameteriv { } ( GLuint buffer, GLenum pname, GLint *params )
+GL-FUNCTION: void glGetNamedBufferParameteri64v { } ( GLuint buffer, GLenum pname, GLint64 *params )
+GL-FUNCTION: void glGetNamedBufferPointerv { } ( GLuint buffer, GLenum pname, void **params )
+GL-FUNCTION: void glGetNamedBufferSubData { } ( GLuint buffer, GLintptr offset, GLsizeiptr size, void *data )
+GL-FUNCTION: void glCreateFramebuffers { } ( GLsizei n, GLuint *framebuffers )
+GL-FUNCTION: void glNamedFramebufferRenderbuffer { } ( GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
+GL-FUNCTION: void glNamedFramebufferParameteri { } ( GLuint framebuffer, GLenum pname, GLint param )
+GL-FUNCTION: void glNamedFramebufferTexture { } ( GLuint framebuffer, GLenum attachment, GLuint texture, GLint level )
+GL-FUNCTION: void glNamedFramebufferTextureLayer { } ( GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer )
+GL-FUNCTION: void glNamedFramebufferDrawBuffer { } ( GLuint framebuffer, GLenum mode )
+GL-FUNCTION: void glNamedFramebufferDrawBuffers { } ( GLuint framebuffer, GLsizei n, GLenum *bufs )
+GL-FUNCTION: void glNamedFramebufferReadBuffer { } ( GLuint framebuffer, GLenum mode )
+GL-FUNCTION: void glInvalidateNamedFramebufferData { } ( GLuint framebuffer, GLsizei numAttachments, GLenum *attachments )
+GL-FUNCTION: void glInvalidateNamedFramebufferSubData { } ( GLuint framebuffer, GLsizei numAttachments, GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height )
+GL-FUNCTION: void glClearNamedFramebufferiv { } ( GLuint framebuffer, GLenum buffer, GLint drawbuffer,  GLint *value )
+GL-FUNCTION: void glClearNamedFramebufferuiv { } ( GLuint framebuffer, GLenum buffer, GLint drawbuffer,  GLuint *value )
+GL-FUNCTION: void glClearNamedFramebufferfv { } ( GLuint framebuffer, GLenum buffer, GLint drawbuffer,  float *value )
+GL-FUNCTION: void glClearNamedFramebufferfi { } ( GLuint framebuffer, GLenum buffer, GLint drawbuffer, float depth, GLint stencil )
+GL-FUNCTION: void glBlitNamedFramebuffer { } ( GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter )
+GL-FUNCTION: void glGetNamedFramebufferParameteriv { } ( GLuint framebuffer, GLenum pname, GLint *param )
+GL-FUNCTION: void glGetNamedFramebufferAttachmentParameteriv { } ( GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params )
+GL-FUNCTION: void glCreateRenderbuffers { } ( GLsizei n, GLuint *renderbuffers )
+GL-FUNCTION: void glNamedRenderbufferStorage { } ( GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height )
+GL-FUNCTION: void glNamedRenderbufferStorageMultisample { } ( GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height )
+GL-FUNCTION: void glGetNamedRenderbufferParameteriv { } ( GLuint renderbuffer, GLenum pname, GLint *params )
+GL-FUNCTION: void glCreateTextures { } ( GLenum target, GLsizei n, GLuint *textures )
+GL-FUNCTION: void glTextureBuffer { } ( GLuint texture, GLenum internalformat, GLuint buffer )
+GL-FUNCTION: void glTextureBufferRange { } ( GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size )
+GL-FUNCTION: void glTextureStorage1D { } ( GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width )
+GL-FUNCTION: void glTextureStorage2D { } ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height )
+GL-FUNCTION: void glTextureStorage3D { } ( GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth )
+GL-FUNCTION: void glTextureStorage2DMultisample { } ( GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height,  GLboolean fixedsamplelocations )
+GL-FUNCTION: void glTextureStorage3DMultisample { } ( GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations )
+GL-FUNCTION: void glTextureSubImage1D { } ( GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, void *pixels )
+GL-FUNCTION: void glTextureSubImage2D { } ( GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels )
+GL-FUNCTION: void glTextureSubImage3D { } ( GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *pixels )
+GL-FUNCTION: void glCompressedTextureSubImage1D { } ( GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize,  void *data )
+GL-FUNCTION: void glCompressedTextureSubImage2D { } ( GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, void *data )
+GL-FUNCTION: void glCompressedTextureSubImage3D { } ( GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize,  void *data )
+GL-FUNCTION: void glCopyTextureSubImage1D { } ( GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width )
+GL-FUNCTION: void glCopyTextureSubImage2D { } ( GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
+GL-FUNCTION: void glCopyTextureSubImage3D { } ( GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height )
+GL-FUNCTION: void glTextureParameterf { } ( GLuint texture, GLenum pname, float param )
+GL-FUNCTION: void glTextureParameterfv { } ( GLuint texture, GLenum pname,  float *param )
+GL-FUNCTION: void glTextureParameteri { } ( GLenum target, GLenum pname, GLint param )
+GL-FUNCTION: void glTextureParameterIiv { } ( GLuint texture, GLenum pname,  GLint *params )
+GL-FUNCTION: void glTextureParameterIuiv { } ( GLuint texture, GLenum pname,  GLuint *params )
+GL-FUNCTION: void glTextureParameteriv { } ( GLuint texture, GLenum pname,  GLint *param )
+GL-FUNCTION: void glGenerateTextureMipmap { } ( GLuint texture )
+GL-FUNCTION: void glBindTextureUnit { } ( GLuint unit, GLuint texture )
+GL-FUNCTION: void glGetTextureImage { } ( GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels )
+GL-FUNCTION: void glGetCompressedTextureImage { } ( GLuint texture, GLint level, GLsizei bufSize, void *pixels )
+GL-FUNCTION: void glGetTextureLevelParameterfv { } ( GLuint texture, GLint level, GLenum pname, float *params )
+GL-FUNCTION: void glGetTextureLevelParameteriv { } ( GLuint texture, GLint level, GLenum pname, GLint *params )
+GL-FUNCTION: void glGetTextureParameterfv { } ( GLuint texture,  GLenum pname, float *params )
+GL-FUNCTION: void glGetTextureParameterIiv { } ( GLuint texture, GLenum pname, GLint *params )
+GL-FUNCTION: void glGetTextureParameterIuiv { } ( GLuint texture, GLenum pname, GLuint *params )
+GL-FUNCTION: void glGetTextureParameteriv { } ( GLuint texture, GLenum pname, GLint *params )
+GL-FUNCTION: void glCreateVertexArrays { } ( GLsizei n, GLuint *arrays )
+GL-FUNCTION: void glDisableVertexArrayAttrib { } ( GLuint vaobj, GLuint index )
+GL-FUNCTION: void glEnableVertexArrayAttrib { } ( GLuint vaobj, GLuint index )
+GL-FUNCTION: void glVertexArrayElementBuffer { } ( GLuint vaobj, GLuint buffer )
+GL-FUNCTION: void glVertexArrayVertexBuffer { } ( GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride )
+GL-FUNCTION: void glVertexArrayVertexBuffers { } ( GLuint vaobj, GLuint first, GLsizei count,  GLuint *buffers, GLintptr *offsets, GLsizei *strides )
+GL-FUNCTION: void glVertexArrayAttribFormat { } ( GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset )
+GL-FUNCTION: void glVertexArrayAttribIFormat { } ( GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset )
+GL-FUNCTION: void glVertexArrayAttribLFormat { } ( GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset )
+GL-FUNCTION: void glVertexArrayAttribBinding { } ( GLuint vaobj, GLuint attribindex, GLuint bindingindex )
+GL-FUNCTION: void glVertexArrayBindingDivisor { } ( GLuint vaobj, GLuint bindingindex, GLuint divisor )
+GL-FUNCTION: void glGetVertexArrayiv { } ( GLuint vaobj, GLenum pname, GLint *param )
+GL-FUNCTION: void glGetVertexArrayIndexediv { } ( GLuint vaobj, GLuint index, GLenum pname, GLint *param )
+GL-FUNCTION: void glGetVertexArrayIndexed64iv { } ( GLuint vaobj, GLuint index, GLenum pname, GLint64 *param )
+GL-FUNCTION: void glCreateSamplers { } ( GLsizei n, GLuint *samplers )
+GL-FUNCTION: void glCreateProgramPipelines { } ( GLsizei n, GLuint *pipelines )
+GL-FUNCTION: void glCreateQueries { } ( GLenum target, GLsizei n, GLuint *ids )
index aa22bcbfa858ef8610bee2401cc1d6e2d3b87ef2..ded3b29d1a50f70358d51b146df33aa2ab03d300 100644 (file)
@@ -34,11 +34,30 @@ HELP: gen-gl-buffer
 { $values { "id" integer } }
 { $description "Wrapper for " { $link glGenBuffers } " to handle the common case of generating a single buffer ID." } ;
 
+HELP: create-gl-buffer
+{ $values { "id" integer } }
+{ $description "Wrapper for " { $link glCreateBuffers } " to handle the common case of generating a single DSA buffer ID." } ;
+
 HELP: delete-gl-buffer
 { $values { "id" integer } }
 { $description "Wrapper for " { $link glDeleteBuffers } " to handle the common case of deleting a single buffer ID." } ;
 
-{ gen-gl-buffer delete-gl-buffer } related-words
+{ gen-gl-buffer create-gl-buffer delete-gl-buffer } related-words
+
+HELP: gen-vertex-array
+{ $values { "id" integer } }
+{ $description "Wrapper for " { $link glGenVertexArrays } " to handle the common case of generating a single vertex array ID." } ;
+
+HELP: create-vertex-array
+{ $values { "id" integer } }
+{ $description "Wrapper for " { $link glCreateVertexArrays } " to handle the common case of generating a single DSA vertex array ID." } ;
+
+HELP: delete-vertex-array
+{ $values { "id" integer } }
+{ $description "Wrapper for " { $link glDeleteVertexArrays } " to handle the common case of deleting a single vertex array ID." } ;
+
+{ gen-gl-buffer create-gl-buffer delete-gl-buffer } related-words
+
 
 HELP: bind-texture-unit
 { $values { "id" "The id of a texture object." } { "target" "The texture target (e.g., " { $snippet "GL_TEXTURE_2D" } ")" } { "unit" "The texture unit to bind (e.g., " { $snippet "GL_TEXTURE0" } ")" } }
index 4ce0da4c8e929761b33c9ff7ab80ea4f4535a3c9..8d95656587d65828a53b801572d3da0c6e638c75 100644 (file)
@@ -169,6 +169,9 @@ MACRO: all-enabled-client-state ( seq quot -- quot )
 : gen-gl-buffer ( -- id )
     [ glGenBuffers ] (gen-gl-object) ;
 
+: create-gl-buffer ( -- id )
+    [ glCreateBuffers ] (gen-gl-object) ;
+
 : delete-gl-buffer ( id -- )
     [ glDeleteBuffers ] (delete-gl-object) ;
 
@@ -184,6 +187,9 @@ MACRO: all-enabled-client-state ( seq quot -- quot )
 : gen-vertex-array ( -- id )
     [ glGenVertexArrays ] (gen-gl-object) ;
 
+: create-vertex-array ( -- id )
+    [ glCreateVertexArrays ] (gen-gl-object) ;
+
 : delete-vertex-array ( id -- )
     [ glDeleteVertexArrays ] (delete-gl-object) ;
 
index f13c9c1e77f7b880a3377fd0ad6283a5d9c7b616..7bde4915777b491526cfe1bb52601778a53a6baf 100644 (file)
@@ -1 +1,2 @@
 Joe Groff
+Sebastian Strobl
index 7b314f92edf596c1aa4f92f71834a96f56e76895..5b9d8d9a807bc39f7372fd8e032f827ade565b63 100644 (file)
@@ -24,6 +24,10 @@ HELP: <fragment-shader>
 { $values { "source" "The GLSL source code to compile" } { "fragment-shader" "a new " { $link fragment-shader } } }
 { $description "Tries to compile the given GLSL source into a fragment shader object. Equivalent to " { $snippet "GL_FRAGMENT_SHADER <gl-shader>" } "." } ;
 
+HELP: <compute-shader>
+{ $values { "source" "The GLSL source code to compile" } { "compute-shader" "a new " { $link compute-shader } } }
+{ $description "Tries to compile the given GLSL source into a compute shader object. Equivalent to " { $snippet "GL_COMPUTE_SHADER <gl-shader>" } "." } ;
+
 HELP: gl-shader
 { $class-description { $snippet "gl-shader" } " is a predicate class comprising values returned by OpenGL to represent shader objects. The following words are provided for creating and manipulating these objects:"
     { $list
@@ -49,6 +53,13 @@ HELP: fragment-shader
     }
 } ;
 
+HELP: compute-shader
+{ $class-description { $snippet "compute-shader" } " is the predicate class of " { $link gl-shader } " objects that refer to shaders of type " { $snippet "GL_COMPUTE_SHADER" } ". In addition to the " { $snippet "gl-shader" } " words, the following compute shader-specific functions are defined:"
+    { $list
+        { { $link <compute-shader> } " - Compile GLSL code into a compute shader object " }
+    }
+} ;
+
 HELP: gl-shader-ok?
 { $values { "shader" "A " { $link gl-shader } " object" } { "?" boolean } }
 { $description "Returns a boolean value indicating whether the given shader object compiled successfully. Compilation errors and warnings are available in the shader's info log, which can be gotten using " { $link gl-shader-info-log } "." } ;
@@ -84,6 +95,12 @@ HELP: <simple-gl-program>
 
 { <gl-program> <simple-gl-program> } related-words
 
+HELP: <compute-program>
+{ $values { "compute-shader-source" "A string containing GLSL compute shader source" } { "program" "a new " { $link gl-program } } }
+{ $description "Wrapper for " { $link <gl-program> } " for the simple case of compiling a compute shader and linking them into a GLSL program. Throws an exception if compiling or linking fails." } ;
+
+{ <gl-program> } related-words
+
 HELP: gl-program-ok?
 { $values { "program" "A " { $link gl-program } " object" } { "?" boolean } }
 { $description "Returns a boolean value indicating whether the given program object linked successfully. Link errors and warnings are available in the program's info log, which can be gotten using " { $link gl-program-info-log } "." } ;
index fd1966d9efc1ecd1cdf26abe89baeb0020095010..05dc8cdbb7bab17f0987bdf7ac58cc6d785f6ba8 100644 (file)
@@ -40,6 +40,14 @@ IN: opengl.shaders
     [ GL_SHADER_TYPE gl-shader-get-int GL_FRAGMENT_SHADER = ]
     [ drop f ] if ;
 
+: <compute-shader> ( source -- compute-shader )
+    GL_COMPUTE_SHADER <gl-shader> ; inline
+
+: (compute-shader?) ( object -- ? )
+    dup (gl-shader?)
+    [ GL_SHADER_TYPE gl-shader-get-int GL_COMPUTE_SHADER = ]
+    [ drop f ] if ;
+
 : gl-shader-info-log-length ( shader -- log-length )
     GL_INFO_LOG_LENGTH gl-shader-get-int ; inline
 
@@ -56,6 +64,7 @@ IN: opengl.shaders
 PREDICATE: gl-shader < integer (gl-shader?) ;
 PREDICATE: vertex-shader < gl-shader (vertex-shader?) ;
 PREDICATE: fragment-shader < gl-shader (fragment-shader?) ;
+PREDICATE: compute-shader < gl-shader (compute-shader?) ;
 
 ! Programs
 
@@ -122,3 +131,6 @@ PREDICATE: gl-program < integer (gl-program?) ;
     [ <vertex-shader> check-gl-shader ]
     [ <fragment-shader> check-gl-shader ] bi*
     2array <gl-program> check-gl-program ;
+
+: <compute-program> ( compute-shader-source -- program ) 
+    <compute-shader> check-gl-shader 1array <gl-program> ;
index 47e33d73e529d1fe2d0606b4b830df428d6aa213..8b6e3208dcba424af43df13373dadd0109597129 100644 (file)
@@ -5,6 +5,10 @@ HELP: gen-texture
 { $values { "id" integer } }
 { $description "Wrapper for " { $link glGenTextures } " to handle the common case of generating a single texture ID." } ;
 
+HELP: create-texture
+{ $values { "id" integer } }
+{ $description "Wrapper for " { $link glCreateTextures } " to handle the common case of generating a single DSA texture ID." } ;
+
 HELP: delete-texture
 { $values { "id" integer } }
 { $description "Wrapper for " { $link glDeleteTextures } " to handle the common case of deleting a single texture ID." } ;
index 347dc3b53b6323a56caaaf69594c994548ce38b5..32f05adbe42952af934e692c0d074a6f924e405c 100644 (file)
@@ -22,6 +22,9 @@ SYMBOL: non-power-of-2-textures?
 
 : gen-texture ( -- id ) [ glGenTextures ] (gen-gl-object) ;
 
+: create-texture ( target -- id ) 
+    [ glCreateTextures ] (gen-gl-object) ;
+
 : delete-texture ( id -- ) [ glDeleteTextures ] (delete-gl-object) ;
 
 ERROR: unsupported-component-order component-order component-type ;
diff --git a/extra/glfw/authors.txt b/extra/glfw/authors.txt
new file mode 100644 (file)
index 0000000..8c7d615
--- /dev/null
@@ -0,0 +1 @@
+Sebastian Strobl\r
diff --git a/extra/glfw/ffi/authors.txt b/extra/glfw/ffi/authors.txt
new file mode 100644 (file)
index 0000000..8c7d615
--- /dev/null
@@ -0,0 +1 @@
+Sebastian Strobl\r
diff --git a/extra/opengl/demos/authors.txt b/extra/opengl/demos/authors.txt
new file mode 100644 (file)
index 0000000..8c7d615
--- /dev/null
@@ -0,0 +1 @@
+Sebastian Strobl\r
diff --git a/extra/opengl/demos/compute/authors.txt b/extra/opengl/demos/compute/authors.txt
new file mode 100644 (file)
index 0000000..8c7d615
--- /dev/null
@@ -0,0 +1 @@
+Sebastian Strobl\r
diff --git a/extra/opengl/demos/compute/compute.factor b/extra/opengl/demos/compute/compute.factor
new file mode 100644 (file)
index 0000000..f45fc26
--- /dev/null
@@ -0,0 +1,158 @@
+! upgraded to opengl4 factor port of https://learnopengl.com/Guest-Articles/2022/Compute-Shaders/Introduction
+USING: accessors alien.c-types alien.data arrays colors
+combinators game.input game.input.scancodes game.loop
+game.worlds kernel literals math multiline opengl opengl.gl
+opengl.shaders opengl.textures sequences
+specialized-arrays.instances.alien.c-types.float ui
+ui.gadgets.worlds ui.pixel-formats ;
+IN: opengl.demos.compute
+
+CONSTANT: TEXTURE_WIDTH 1000
+CONSTANT: TEXTURE_HEIGHT 1000
+
+STRING: compute-shader
+#version 430 core
+layout (local_size_x = 10, local_size_y = 10, local_size_z = 1) in;
+
+layout(rgba32f, binding = 0) uniform image2D imgOutput;
+
+layout (location = 0) uniform float t;
+       
+void main() {
+    vec4 value = vec4(0.0, 0.0, 0.0, 1.0);
+    ivec2 texelCoord = ivec2(gl_GlobalInvocationID.xy);
+    float speed = 100;
+    float width = 1000;
+
+    value.x = mod(float(texelCoord.x) + t * speed, width) / (gl_NumWorkGroups.x);
+    value.y = float(texelCoord.y) / (gl_NumWorkGroups.y);
+    imageStore(imgOutput, texelCoord, value);
+}
+;
+
+STRING: vertex-shader
+#version 430 core
+layout (location = 0) in vec3 aPos;
+layout (location = 1) in vec2 aTexCoords;
+
+out vec2 TexCoords;
+
+void main()
+{
+    TexCoords = aTexCoords;
+    gl_Position = vec4(aPos, 1.0);
+}
+;
+
+STRING: fragment-shader
+#version 430 core
+out vec4 FragColor;
+
+in vec2 TexCoords;
+
+uniform sampler2D tex;
+
+void main()
+{             
+    vec3 texCol = texture(tex, TexCoords).rgb;      
+    FragColor = vec4(texCol, 1.0);
+}
+;
+
+: ref ( value c-type quot -- value ) 
+  -rot [ <ref> ] keep [ drop swap call ] 2keep deref ; inline
+
+TUPLE: gl4compute-world < game-world
+  program compute-program 
+  texture vertices vao vbo 
+  { frame-count fixnum initial: 0 } ;
+
+M: gl4compute-world begin-game-world
+  vertex-shader fragment-shader <simple-gl-program> >>program
+  compute-shader <compute-program> >>compute-program
+
+  float-array{ 
+    -1.0  1.0  0.0  0.0  1.0
+    -1.0 -1.0  0.0  0.0  0.0
+     1.0  1.0  0.0  1.0  1.0
+     1.0 -1.0  0.0  1.0  0.0 
+  } >>vertices
+
+  create-vertex-array >>vao
+  create-gl-buffer >>vbo
+
+  dup [ vbo>> ] [ vertices>> length 4 * ] [ vertices>> ] tri GL_STATIC_DRAW glNamedBufferData
+  
+  dup [ vao>> 0 ] [ vbo>> ] bi 0 5 4 * glVertexArrayVertexBuffer
+  dup vao>> {
+    [ 0 glEnableVertexArrayAttrib ]
+    [ 0 3 GL_FLOAT GL_FALSE 0 glVertexArrayAttribFormat ]
+    [ 0 0 glVertexArrayAttribBinding ]
+
+    [ 1 glEnableVertexArrayAttrib ]
+    [ 1 2 GL_FLOAT GL_FALSE 3 4 * glVertexArrayAttribFormat ]
+    [ 1 0 glVertexArrayAttribBinding ]
+  } cleave
+
+  GL_TEXTURE_2D create-texture >>texture
+  dup texture>> {
+    [ 1 GL_RGBA32F TEXTURE_WIDTH TEXTURE_HEIGHT glTextureStorage2D ]
+    [ GL_TEXTURE_WRAP_S GL_CLAMP_TO_EDGE glTextureParameteri ]
+    [ GL_TEXTURE_WRAP_T GL_CLAMP_TO_EDGE glTextureParameteri ]
+    [ GL_TEXTURE_MAG_FILTER GL_LINEAR glTextureParameteri ]
+    [ GL_TEXTURE_MIN_FILTER GL_LINEAR glTextureParameteri ]
+  } cleave
+  dup texture>> 0 swap 0 GL_FALSE 0 GL_READ_WRITE GL_RGBA32F glBindImageTexture
+  drop ;
+
+M: gl4compute-world end-game-world 
+  dup compute-program>> delete-gl-program
+  dup program>> delete-gl-program
+  dup texture>> delete-texture
+  dup vbo>> delete-gl-buffer
+  dup vao>> delete-vertex-array
+  drop ;
+
+:: handle-input ( world -- )  
+  read-keyboard keys>> :> keys
+  key-escape keys nth [ world close-window ] when
+;
+
+M: gl4compute-world tick-game-world 
+  dup handle-input 
+  dup frame-count>> dup 500 > [ drop 0 ] [ 1 + ] if >>frame-count
+  drop ;
+
+M: gl4compute-world draw-world* 
+  dup compute-program>> glUseProgram 
+  dup [ compute-program>> ] [ compute-program>> "t" glGetUniformLocation ] [ frame-count>> ] tri glProgramUniform1f
+  TEXTURE_WIDTH 10 / TEXTURE_HEIGHT 10 / 1 glDispatchCompute
+  GL_SHADER_IMAGE_ACCESS_BARRIER_BIT glMemoryBarrier
+
+  GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT bitor glClear
+
+  dup program>> glUseProgram
+
+  dup [ program>> ] [ program>> "tex" glGetUniformLocation ] bi 0 glProgramUniform1i
+  dup texture>> 0 swap glBindTextureUnit
+
+  dup vao>> glBindVertexArray
+  GL_TRIANGLE_STRIP 0 4 glDrawArrays
+  0 glBindVertexArray
+
+  drop ;
+
+GAME: gl4compute {
+  { world-class gl4compute-world }
+  { title "gl4 compute demo" }
+  { pixel-format-attributes { 
+    windowed 
+    double-buffered
+    T{ depth-bits { value 24 } }
+  } }
+  { use-game-input? t }
+  { grab-input? t }
+  { pref-dim { 1280 720 } }
+  { tick-interval-nanos $[ 60 fps ] }
+} ;
diff --git a/extra/opengl/demos/demos.factor b/extra/opengl/demos/demos.factor
new file mode 100644 (file)
index 0000000..059e250
--- /dev/null
@@ -0,0 +1,13 @@
+USING: accessors kernel ui ui.gadgets ui.gadgets.borders
+ui.gadgets.buttons ui.gadgets.packs ;
+FROM: opengl.demos.gl4 => gl4demo ;
+FROM: opengl.demos.compute => gl4compute ;
+IN: opengl.demos
+
+MAIN-WINDOW: nehe-window { { title "Nehe Examples" } }
+    <filled-pile>
+        "OpenGL 4" [ drop gl4demo ] <border-button> add-gadget
+        "OpenGL 4 Compute" [ drop gl4compute ] <border-button> add-gadget
+    { 2 2 } <border> >>gadgets ;
+
+MAIN: nehe-window
diff --git a/extra/opengl/demos/gl4/authors.txt b/extra/opengl/demos/gl4/authors.txt
new file mode 100644 (file)
index 0000000..8c7d615
--- /dev/null
@@ -0,0 +1 @@
+Sebastian Strobl\r
diff --git a/extra/opengl/demos/gl4/gl4.factor b/extra/opengl/demos/gl4/gl4.factor
new file mode 100644 (file)
index 0000000..63db2ed
--- /dev/null
@@ -0,0 +1,86 @@
+! upgraded to opengl4 factor port of https://learnopengl.com/Getting-started/Hello-Triangle
+USING: accessors alien.c-types alien.data colors game.input
+game.input.scancodes game.loop game.worlds kernel literals math
+multiline opengl opengl.gl opengl.shaders sequences
+specialized-arrays.instances.alien.c-types.float ui
+ui.gadgets.worlds ui.pixel-formats ;
+IN: opengl.demos.gl4
+
+STRING: testing-vertex-shader
+  #version 450 core
+  layout (location = 0) in vec3 aPos;
+  
+  void main () {
+    gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);
+  }
+;
+
+STRING: testing-fragment-shader
+  #version 450 core
+  out vec4 FragColor;
+  void main () {
+    FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
+  }
+;
+
+: ref ( value c-type quot -- value ) 
+  -rot [ <ref> ] keep [ drop swap call ] 2keep deref ; inline
+
+TUPLE: gl4demo-world < game-world
+  testing-program
+  vertices vbo vao ;
+
+M: gl4demo-world begin-game-world 
+  testing-vertex-shader testing-fragment-shader <simple-gl-program> >>testing-program 
+  float-array{ -0.5 -0.5 0.0   0.5 -0.5 0.0   0.0 0.5 0.0 } >>vertices
+  
+  1 0 uint [ glCreateVertexArrays ] ref >>vao
+  1 0 uint [ glCreateBuffers ] ref >>vbo
+
+  dup [ vbo>> ] [ vertices>> length 4 * ] [ vertices>> ] tri GL_STATIC_DRAW glNamedBufferData
+  
+  dup [ vao>> 0 ] [ vbo>> ] bi 0 3 4 * glVertexArrayVertexBuffer
+  
+  dup vao>> 0 glEnableVertexArrayAttrib
+  dup vao>> 0 3 GL_FLOAT GL_FALSE 0 glVertexArrayAttribFormat
+  
+  dup vao>> 0 0 glVertexArrayAttribBinding
+
+  drop ;
+
+M: gl4demo-world end-game-world 
+  dup testing-program>> delete-gl-program
+  dup vbo>> delete-gl-buffer
+  dup vao>> delete-vertex-array
+  drop ;
+
+:: handle-input ( world -- )  
+  read-keyboard keys>> :> keys
+  key-escape keys nth [ world close-window ] when
+;
+
+M: gl4demo-world tick-game-world 
+  handle-input ;
+
+M: gl4demo-world draw-world*
+  COLOR: aqua gl-clear
+
+  dup testing-program>> [
+    over vao>> glBindVertexArray
+    GL_TRIANGLES 0 3 glDrawArrays drop
+  ] with-gl-program drop ;
+
+GAME: gl4demo {
+  { world-class gl4demo-world }
+  { title "gl4demo" }
+  { pixel-format-attributes { 
+    windowed 
+    double-buffered
+    T{ depth-bits { value 24 } }
+  } }
+  { use-game-input? t }
+  { grab-input? t }
+  { pref-dim { 1280 720 } }
+  { tick-interval-nanos $[ 60 fps ] }
+} ;