just create texture storage
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
#include "opengl_presentation_queue.h"
|
#include "opengl_presentation_queue.h"
|
||||||
#include "surface/opengl_surface.h"
|
#include "surface/opengl_surface.h"
|
||||||
#include "textures/opengl_texture.h"
|
#include "textures/opengl_texture.h"
|
||||||
#include "stdio.h"
|
|
||||||
|
|
||||||
gnReturnCode createOpenGLPresentationQueue(gnPresentationQueueHandle presentationQueue, gnOutputDeviceHandle device, gnPresentationQueueInfo presentationInfo) {
|
gnReturnCode createOpenGLPresentationQueue(gnPresentationQueueHandle presentationQueue, gnOutputDeviceHandle device, gnPresentationQueueInfo presentationInfo) {
|
||||||
presentationQueue->presentationQueue = malloc(sizeof(struct gnPlatformPresentationQueue_t));
|
presentationQueue->presentationQueue = malloc(sizeof(struct gnPlatformPresentationQueue_t));
|
||||||
@@ -13,19 +12,13 @@ gnReturnCode createOpenGLPresentationQueue(gnPresentationQueueHandle presentatio
|
|||||||
for (int i = 0; i < presentationInfo.minImageCount; i++) {
|
for (int i = 0; i < presentationInfo.minImageCount; i++) {
|
||||||
presentationQueue->images[i] = malloc(sizeof(struct gnTexture_t));
|
presentationQueue->images[i] = malloc(sizeof(struct gnTexture_t));
|
||||||
presentationQueue->images[i]->texture = malloc(sizeof(gnPlatformTexture));
|
presentationQueue->images[i]->texture = malloc(sizeof(gnPlatformTexture));
|
||||||
glGenTextures(1, &presentationQueue->images[i]->texture->id);
|
glCreateTextures(GL_TEXTURE_2D, 1, &presentationQueue->images[i]->texture->id);
|
||||||
|
glTextureStorage2D(
|
||||||
glTexImage2D(
|
presentationQueue->images[i]->texture->id,
|
||||||
GL_TEXTURE_2D,
|
1,
|
||||||
0,
|
|
||||||
glGryphnFormatToOpenGLInternalFormat(presentationInfo.format.format),
|
glGryphnFormatToOpenGLInternalFormat(presentationInfo.format.format),
|
||||||
presentationInfo.imageSize.x, presentationInfo.imageSize.y,
|
presentationInfo.imageSize.x, presentationInfo.imageSize.y
|
||||||
0,
|
|
||||||
glGryphnFormatToOpenGLFormat(presentationInfo.format.format),
|
|
||||||
GL_UNSIGNED_BYTE,
|
|
||||||
NULL
|
|
||||||
);
|
);
|
||||||
|
|
||||||
GLuintArrayListAdd(presentationQueue->presentationQueue->textures, presentationQueue->images[i]->texture->id);
|
GLuintArrayListAdd(presentationQueue->presentationQueue->textures, presentationQueue->images[i]->texture->id);
|
||||||
uint32_tArrayListAdd(presentationQueue->presentationQueue->avaliableTextures, i);
|
uint32_tArrayListAdd(presentationQueue->presentationQueue->avaliableTextures, i);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user