Skip to content

Commit

Permalink
glTexImage2D NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
elect86 committed Dec 21, 2017
1 parent 90e9194 commit cdce861
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/kotlin/gln/texture/texture.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ inline fun glTexImage2D(internalformat: Int, width: Int, height: Int, format: In
inline fun glTexImage2D(level: Int, internalformat: gl.InternalFormat, width: Int, height: Int, format: gl.ExternalFormat, type: gl.TypeFormat, pixels: ByteBuffer) = GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, level, internalformat.i, width, height, 0, format.i, type.i, MemoryUtil.memAddress(pixels, pixels.position()))
inline fun glTexImage2D(internalformat: gl.InternalFormat, width: Int, height: Int, format: gl.ExternalFormat, type: gl.TypeFormat, pixels: ByteBuffer) = glTexImage2D(0, internalformat, width, height, format, type, pixels)

// bufferless
// bufferless
inline fun glTexImage2D(level: Int, internalformat: Int, width: Int, height: Int, format: Int, type: Int) = GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, level, internalformat, width, height, 0, format, type, NULL)

inline fun glTexImage2D(internalformat: Int, width: Int, height: Int, format: Int, type: Int) = glTexImage2D(0, internalformat, width, height, format, type)

inline fun glTexImage2D(level: Int, internalformat: gl.InternalFormat, width: Int, height: Int, format: gl.ExternalFormat, type: gl.TypeFormat) = GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, level, internalformat.i, width, height, 0, format.i, type.i, NULL)
Expand All @@ -52,13 +53,15 @@ inline fun glTexImage2D(internalformat: gl.InternalFormat, width: Int, height: I

// glm size
inline fun glTexImage2D(level: Int, internalformat: Int, size: Vec2i, format: Int, type: Int, pixels: ByteBuffer) = GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, level, internalformat, size.x, size.y, 0, format, type, MemoryUtil.memAddress(pixels, pixels.position()))

inline fun glTexImage2D(internalformat: Int, size: Vec2i, format: Int, type: Int, pixels: ByteBuffer) = glTexImage2D(0, internalformat, size, format, type, pixels)

inline fun glTexImage2D(level: Int, internalformat: gl.InternalFormat, size: Vec2i, format: gl.ExternalFormat, type: gl.TypeFormat, pixels: ByteBuffer) = GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, level, internalformat.i, size.x, size.y, 0, format.i, type.i, MemoryUtil.memAddress(pixels, pixels.position()))
inline fun glTexImage2D(internalformat: gl.InternalFormat, size: Vec2i, format: gl.ExternalFormat, type: gl.TypeFormat, pixels: ByteBuffer) = glTexImage2D(0, internalformat, size, format, type, pixels)

// bufferless
// bufferless
inline fun glTexImage2D(level: Int, internalformat: Int, size: Vec2i, format: Int, type: Int) = GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, level, internalformat, size.x, size.y, 0, format, type, NULL)

inline fun glTexImage2D(internalformat: Int, size: Vec2i, format: Int, type: Int) = glTexImage2D(0, internalformat, size, format, type)

inline fun glTexImage2D(level: Int, internalformat: gl.InternalFormat, size: Vec2i, format: gl.ExternalFormat, type: gl.TypeFormat) = GL11.nglTexImage2D(GL11.GL_TEXTURE_2D, level, internalformat.i, size.x, size.y, 0, format.i, type.i, NULL)
Expand Down

0 comments on commit cdce861

Please sign in to comment.