Skip to content

Commit

Permalink
Minor update to some rendering functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLarson committed Jul 6, 2017
1 parent df42687 commit 3251169
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion framework/Source/OpenGLRendering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func textureUnitForIndex(_ index:Int) -> GLenum {
}
}

func generateTexture(minFilter:Int32, magFilter:Int32, wrapS:Int32, wrapT:Int32) -> GLuint {
public func generateTexture(minFilter:Int32, magFilter:Int32, wrapS:Int32, wrapT:Int32) -> GLuint {
var texture:GLuint = 0

glActiveTexture(GLenum(GL_TEXTURE1))
Expand All @@ -186,6 +186,13 @@ func generateTexture(minFilter:Int32, magFilter:Int32, wrapS:Int32, wrapT:Int32)
return texture
}

public func uploadLocalArray(data:[GLfloat], into texture:GLuint, size:GLSize) {
glActiveTexture(GLenum(GL_TEXTURE1))
glBindTexture(GLenum(GL_TEXTURE_2D), texture)
glTexImage2D(GLenum(GL_TEXTURE_2D), 0, GL_RGBA, size.width, size.height, 0, GLenum(GL_RGBA), GLenum(GL_FLOAT), data)
glBindTexture(GLenum(GL_TEXTURE_2D), 0)
}

func generateFramebufferForTexture(_ texture:GLuint, width:GLint, height:GLint, internalFormat:Int32, format:Int32, type:Int32, stencil:Bool) throws -> (GLuint, GLuint?) {
var framebuffer:GLuint = 0
glActiveTexture(GLenum(GL_TEXTURE1))
Expand Down

0 comments on commit 3251169

Please sign in to comment.