mirror of https://github.com/bjornbytes/lovr.git
Fix CMake;
This commit is contained in:
parent
ef7ebaef85
commit
fa771b04bd
|
@ -414,16 +414,11 @@ endif()
|
|||
if(LOVR_ENABLE_GRAPHICS)
|
||||
add_definitions(-DLOVR_ENABLE_GRAPHICS)
|
||||
target_sources(lovr PRIVATE
|
||||
src/modules/graphics/buffer.c
|
||||
src/modules/graphics/canvas.c
|
||||
src/modules/graphics/font.c
|
||||
src/modules/graphics/graphics.c
|
||||
src/modules/graphics/material.c
|
||||
src/modules/graphics/mesh.c
|
||||
src/modules/graphics/model.c
|
||||
src/modules/graphics/opengl.c
|
||||
src/modules/graphics/shader.c
|
||||
src/modules/graphics/texture.c
|
||||
src/api/l_graphics.c
|
||||
src/api/l_graphics_canvas.c
|
||||
src/api/l_graphics_font.c
|
||||
|
|
|
@ -1776,6 +1776,10 @@ void lovrTextureReplacePixels(Texture* texture, TextureData* textureData, uint32
|
|||
}
|
||||
}
|
||||
|
||||
uint64_t lovrTextureGetId(Texture* texture) {
|
||||
return texture->id;
|
||||
}
|
||||
|
||||
uint32_t lovrTextureGetWidth(Texture* texture, uint32_t mipmap) {
|
||||
return MAX(texture->width >> mipmap, 1);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ Texture* lovrTextureCreateFromHandle(uint32_t handle, TextureType type, uint32_t
|
|||
void lovrTextureDestroy(void* ref);
|
||||
void lovrTextureAllocate(Texture* texture, uint32_t width, uint32_t height, uint32_t depth, TextureFormat format);
|
||||
void lovrTextureReplacePixels(Texture* texture, struct TextureData* data, uint32_t x, uint32_t y, uint32_t slice, uint32_t mipmap);
|
||||
uint64_t lovrTextureGetId(Texture* texture);
|
||||
uint32_t lovrTextureGetWidth(Texture* texture, uint32_t mipmap);
|
||||
uint32_t lovrTextureGetHeight(Texture* texture, uint32_t mipmap);
|
||||
uint32_t lovrTextureGetDepth(Texture* texture, uint32_t mipmap);
|
||||
|
|
|
@ -673,7 +673,7 @@ static void openvr_renderTo(void (*callback)(void*), void* userdata) {
|
|||
|
||||
// Submit
|
||||
const Attachment* attachments = lovrCanvasGetAttachments(state.canvas, NULL);
|
||||
ptrdiff_t id = attachments[0].texture->id;
|
||||
ptrdiff_t id = lovrTextureGetId(attachments[0].texture);
|
||||
Texture_t eyeTexture = { (void*) id, ETextureType_TextureType_OpenGL, EColorSpace_ColorSpace_Linear };
|
||||
VRTextureBounds_t left = { 0.f, 0.f, .5f, 1.f };
|
||||
VRTextureBounds_t right = { .5f, 0.f, 1.f, 1.f };
|
||||
|
|
Loading…
Reference in New Issue