Translate VAOs to DSA
This commit is contained in:
@@ -38,7 +38,7 @@ addTexture2D nlev minfilt magfilt texpath shad = do
|
||||
let texdata = convertRGBA8 cmap
|
||||
let wtex = fromIntegral $ imageWidth texdata
|
||||
htex = fromIntegral $ imageHeight texdata
|
||||
texname <- mglCreateSingle $ glCreateTextures GL_TEXTURE_2D 1
|
||||
texname <- mglCreateSingle $ glCreateTextures GL_TEXTURE_2D
|
||||
glTextureStorage2D texname nlev GL_RGBA8 wtex htex
|
||||
VS.unsafeWith (imageData texdata) $ \ptr -> do
|
||||
glTextureSubImage2D texname 0 0 0 wtex htex GL_RGBA GL_UNSIGNED_BYTE ptr
|
||||
@@ -69,7 +69,7 @@ addTextureArray texturePath shad = do
|
||||
print err
|
||||
Right cmap <- readImage texturePath
|
||||
let texdata = convertRGBA8 cmap
|
||||
texname <- mglCreateSingle $ glCreateTextures GL_TEXTURE_2D_ARRAY 1
|
||||
texname <- mglCreateSingle $ glCreateTextures GL_TEXTURE_2D_ARRAY
|
||||
glTextureStorage3D texname 3 GL_RGBA8 32 32 64
|
||||
VS.unsafeWith (imageData texdata) $ \ptr -> do
|
||||
glTextureSubImage3D texname 0 0 0 0 32 32 64 GL_RGBA GL_UNSIGNED_BYTE ptr
|
||||
|
||||
Reference in New Issue
Block a user