Module opengl.gles20

Информация

The gles20 module provides a Monkey wrapper for the OpenGL ES 2.0

Подробнее...

Подробное описание

The gles20 module provides a Monkey wrapper for the OpenGL ES 2.0 API on the android, glfw, html5 and ios targets.

The Monkey API is based on the 'C' API, with a few modifications:

  • The glGen and glDelete functions have been replaced with WebGL style glCreate and glDelete functions.
  • Monkey arrays are used to represent typed pointer parameters. It is up to you to ensure such arrays are large enough for the function being called - you should assume no runtime checking is performed.
  • DataBuffer objects are used to represent void pointer parameters. Again, it is up to you to ensure such databuffers are large enough for the function being called.
  • Versions of glTexImage that take image file paths have been added to all targets.
To import the gles20 module into your app, use: Import opengl.gles20.

The opengl modules currently depend on the the mojo module to create and manage opengl contexts, so you must also import mojo.

HTML5 notes

You will need a web browser that supports WebGL.

Client side arrays are not supported in WebGL, so the versions of glVertexAttribPointer and glDrawElements that take a DataBuffer parameter are also not supported. You must use vertex buffer objects for vertex and index data on the HTML5 target.

LoadImageData is not supported on HTML5, so the only way you can load an image file into a texture is by using the versions of glTexImage that take an image path parameter.

Android notes

GLES2.0 is only available on API 8 or higher. In addition, if you want to target API 8 (Android 2.2 'Froyo') and want to use vertex buffer objects, you must set the app config setting "ANDROID_NATIVE_GL_ENABLED" to "true". This will cause some 'native code' to be added to your app that works around an issue in Android API 8. Note that this is not necessary if you are targeting API 9 or higher.

GLFW notes

Your graphics driver must support OpenGL2.0 or higher.

См. также
DataBuffer, LoadImageData, App config settings, OpenGL ES 2.0 reference

Функции

Function LoadImageData:DataBuffer ( path:String, info:Int[] )


LoadImageData is a helper function that loads an image in your app's .data directory into a databuffer.

Upon success, info[0] is initialized to the width of the image, and info[1] is initialized to the height of the image. If the info array is not long enough, info is not written.

The image is returned in tightly packed, byte-per-component R,G,B,A format.

IMPORTANT: LoadImageData is not currently available on the HTML5 target.

См. также
DataBuffer

Function glActiveTexture:Void ( texture:Int )


Function glAttachShader:Void ( program:Int, shader:Int )


Function glBindAttribLocation:Void ( program:Int, index:Int, name:String )


Function glBindBuffer:Void ( target:Int, buffer:Int )


Function glBindFramebuffer:Void ( target:Int, framebuffer:Int )


Function glBindRenderbuffer:Void ( target:Int, renderbuffer:Int )


Function glBindTexture:Void ( target:Int, texture:Int )


Function glBlendColor:Void ( red:Float, green:Float, blue:Float, alpha:Float )


Function glBlendEquation:Void ( mode:Int )


Function glBlendEquationSeparate:Void ( modeRGB:Int, modeAlpha:Int )


Function glBlendFunc:Void ( sfactor:Int, dfactor:Int )


Function glBlendFuncSeparate:Void ( srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int )


Function glBufferData:Void ( target:Int, size:Int, data:DataBuffer, usage:Int )


Function glBufferSubData:Void ( target:Int, offset:Int, size:Int, data:DataBuffer )


Function glCheckFramebufferStatus:Int ( target:Int )


Function glClear:Void ( mask:Int )


Function glClearColor:Void ( red:Float, green:Float, blue:Float, alpha:Float )


Function glClearDepthf:Void ( depth:Float )


Function glClearStencil:Void ( s:Int )


Function glColorMask:Void ( red:Bool, green:Bool, blue:Bool, alpha:Bool )


Function glCompileShader:Void ( shader:Int )


Function glCopyTexImage2D:Void ( target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int )


Function glCopyTexSubImage2D:Void ( target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int )


Function glCreateBuffer:Int ()


Function glCreateFramebuffer:Int ()


Function glCreateProgram:Int ()


Function glCreateRenderbuffer:Int ()


Function glCreateShader:Int ( type:Int )


Function glCreateTexture:Int ()


Function glCullFace:Void ( mode:Int )


Function glDeleteBuffer:Void ( buffer:Int )


Function glDeleteFramebuffer:Void ( framebuffer:Int )


Function glDeleteProgram:Void ( program:Int )


Function glDeleteRenderbuffer:Void ( renderBuffer:Int )


Function glDeleteShader:Void ( shader:Int )


Function glDeleteTexture:Void ( texture:Int )


Function glDepthFunc:Void ( func:Int )


Function glDepthMask:Void ( flag:Bool )


Function glDepthRangef:Void ( zNear:Float, zFar:Float )


Function glDetachShader:Void ( program:Int, shader:Int )


Function glDisable:Void ( cap:Int )


Function glDisableVertexAttribArray:Void ( index:Int )


Function glDrawArrays:Void ( mode:Int, first:Int, count:Int )


Function glDrawElements:Void ( mode:Int, count:Int, type:Int, ptr:DataBuffer )


Function glDrawElements:Void ( mode:Int, count:Int, type:Int, offset:Int )


Function glEnable:Void ( cap:Int )


Function glEnableVertexAttribArray:Void ( index:Int )


Function glFinish:Void ()


Function glFlush:Void ()


Function glFramebufferRenderbuffer:Void ( target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:Int )


Function glFramebufferTexture2D:Void ( target:Int, attachment:Int, textarget:Int, texture:Int, level:Int )


Function glFrontFace:Void ( mode:Int )


Function glGenerateMipmap:Void ( target:Int )


Function glGetActiveAttrib:Void ( program:Int, index:Int, size:Int[], type:Int[], name:String[] )


Function glGetActiveUniform:Void ( program:Int, index:Int, size:Int[], type:Int[], name:String[] )


Function glGetAttachedShaders:Void ( program:Int, maxcount:Int, count:Int[], shaders:Int[] )


Function glGetAttribLocation:Int ( program:Int, name:String )


Function glGetBooleanv:Void ( pname:Int, params:Bool[] )


Function glGetBufferParameteriv:Void ( target:Int, pname:Int, params:Int[] )


Function glGetError:Int ()


Function glGetFloatv:Void ( pname:Int, params:Float[] )


Function glGetFramebufferAttachmentParameteriv:Void ( target:Int, attachment:Int, pname:Int, params:Int[] )


Function glGetIntegerv:Void ( pname:Int, params:Int[] )


Function glGetProgramInfoLog:String ( program:Int )


Function glGetProgramiv:Void ( program:Int, pname:Int, params:Int[] )


Function glGetRenderbufferParameteriv:Void ( target:Int, pname:Int, params:Int[] )


Function glGetShaderInfoLog:String ( shader:Int )


Function glGetShaderSource:String ( shader:Int )


Function glGetShaderiv:Void ( shader:Int, pname:Int, params:Int[] )


Function glGetString:String ( name:Int )


Function glGetTexParameterfv:Void ( target:Int, pname:Int, params:Float[] )


Function glGetTexParameteriv:Void ( target:Int, pname:Int, params:Int[] )


Function glGetUniformLocation:Int ( program:Int, name:String )


Function glGetUniformfv:Void ( program:Int, location:Int, params:Float[] )


Function glGetUniformiv:Void ( program:Int, location:Int, params:Int[] )


Function glGetVertexAttribfv:Void ( index:Int, pname:Int, params:Float[] )


Function glGetVertexAttribiv:Void ( index:Int, pname:Int, params:Int[] )


Function glHint:Void ( target:Int, mode:Int )


Function glIsBuffer:Bool ( buffer:Int )


Function glIsEnabled:Bool ( cap:Int )


Function glIsFramebuffer:Bool ( framebuffer:Int )


Function glIsProgram:Bool ( program:Int )


Function glIsRenderbuffer:Bool ( renderbuffer:Int )


Function glIsShader:Bool ( shader:Int )


Function glIsTexture:Bool ( texture:Int )


Function glLineWidth:Void ( width:Float )


Function glLinkProgram:Void ( program:Int )


Function glPixelStorei:Void ( pname:Int, param:Int )


Function glPolygonOffset:Void ( factor:Float, units:Float )


Function glReadPixels:Void ( x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:DataBuffer )


Function glReleaseShaderCompiler:Void ()


Function glRenderbufferStorage:Void ( target:Int, internalformat:Int, width:Int, height:Int )


Function glSampleCoverage:Void ( value:Float, invert:Bool )


Function glScissor:Void ( x:Int, y:Int, width:Int, height:Int )


Function glShaderSource:Void ( shader:Int, source:String )


Function glStencilFunc:Void ( func:Int, ref:Int, mask:Int )


Function glStencilFuncSeparate:Void ( face:Int, func:Int, ref:Int, mask:Int )


Function glStencilMask:Void ( mask:Int )


Function glStencilMaskSeparate:Void ( face:Int, mask:Int )


Function glStencilOp:Void ( fail:Int, zfail:Int, zpass:Int )


Function glStencilOpSeparate:Void ( face:Int, fail:Int, zfail:Int, zpass:Int )


Function glTexImage2D:Void ( target:Int, level:Int, internalformat:Int, format:Int, type:Int, path:String )


Function glTexImage2D:Void ( target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, pixels:DataBuffer )


Function glTexParameterf:Void ( target:Int, pname:Int, param:Float )


Function glTexParameteri:Void ( target:Int, pname:Int, param:Int )


Function glTexSubImage2D:Void ( target:Int, level:Int, xoffset:Int, yoffset:Int, format:Int, type:Int, path:String )


Function glTexSubImage2D:Void ( target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, pixels:DataBuffer )


Function glUniform1f:Void ( location:Int, x:Float )


Function glUniform1fv:Void ( location:Int, count:Int, v:Float[] )


Function glUniform1i:Void ( location:Int, x:Int )


Function glUniform1iv:Void ( location:Int, count:Int, v:Int[] )


Function glUniform2f:Void ( location:Int, x:Float, y:Float )


Function glUniform2fv:Void ( location:Int, count:Int, v:Float[] )


Function glUniform2i:Void ( location:Int, x:Int, y:Int )


Function glUniform2iv:Void ( location:Int, count:Int, v:Int[] )


Function glUniform3f:Void ( location:Int, x:Float, y:Float, z:Float )


Function glUniform3fv:Void ( location:Int, count:Int, v:Float[] )


Function glUniform3i:Void ( location:Int, x:Int, y:Int, z:Int )


Function glUniform3iv:Void ( location:Int, count:Int, v:Int[] )


Function glUniform4f:Void ( location:Int, x:Float, y:Float, z:Float, w:Float )


Function glUniform4fv:Void ( location:Int, count:Int, v:Float[] )


Function glUniform4i:Void ( location:Int, x:Int, y:Int, z:Int, w:Int )


Function glUniform4iv:Void ( location:Int, count:Int, v:Int[] )


Function glUniformMatrix2fv:Void ( location:Int, count:Int, transpose:Bool, value:Float[] )


Function glUniformMatrix3fv:Void ( location:Int, count:Int, transpose:Bool, value:Float[] )


Function glUniformMatrix4fv:Void ( location:Int, count:Int, transpose:Bool, value:Float[] )


Function glUseProgram:Void ( program:Int )


Function glValidateProgram:Void ( program:Int )


Function glVertexAttrib1f:Void ( indx:Int, x:Float )


Function glVertexAttrib1fv:Void ( indx:Int, values:Float[] )


Function glVertexAttrib2f:Void ( indx:Int, x:Float, y:Float )


Function glVertexAttrib2fv:Void ( indx:Int, values:Float[] )


Function glVertexAttrib3f:Void ( indx:Int, x:Float, y:Float, z:Float )


Function glVertexAttrib3fv:Void ( indx:Int, values:Float[] )


Function glVertexAttrib4f:Void ( indx:Int, x:Float, y:Float, z:Float, w:Float )


Function glVertexAttrib4fv:Void ( indx:Int, values:Float[] )


Function glVertexAttribPointer:Void ( indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, data:DataBuffer )


Function glVertexAttribPointer:Void ( indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:Int )


Function glViewport:Void ( x:Int, y:Int, width:Int, height:Int )