imGui: Fix compile errors

This commit is contained in:
joel16 2023-03-17 11:59:11 -04:00
parent c3a4e9332a
commit 11c304baff
4 changed files with 8 additions and 4 deletions

1
.gitignore vendored
View File

@ -42,3 +42,4 @@ cmake_install.cmake
VITA-Homebrew-Sorter VITA-Homebrew-Sorter
*.vpk *.vpk
*.sfo *.sfo
eboot.bin

View File

@ -89,10 +89,10 @@ target_link_libraries(${PROJECT_NAME}
) )
## Create Vita files ## Create Vita files
vita_create_self(${PROJECT_NAME}.self ${PROJECT_NAME} UNSAFE) vita_create_self(eboot.bin ${PROJECT_NAME} UNSAFE)
# The FILE directive lets you add additional files to the VPK, the syntax is # The FILE directive lets you add additional files to the VPK, the syntax is
# FILE src_path dst_path_in_vpk. In this case, we add the LiveArea paths. # FILE src_path dst_path_in_vpk. In this case, we add the LiveArea paths.
vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} ${PROJECT_NAME}.self vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} eboot.bin
VERSION ${VITA_VERSION} VERSION ${VITA_VERSION}
NAME ${VITA_APP_NAME} NAME ${VITA_APP_NAME}
FILE sce_sys/icon0.png sce_sys/icon0.png FILE sce_sys/icon0.png sce_sys/icon0.png

View File

@ -7,8 +7,8 @@
#include "applist.h" #include "applist.h"
#include "config.h" #include "config.h"
#include "fs.h" #include "fs.h"
#include "imgui_impl_vitagl.h"
#define IMGUI_DEFINE_MATH_OPERATORS #define IMGUI_DEFINE_MATH_OPERATORS
#include "imgui_impl_vitagl.h"
#include "imgui_internal.h" #include "imgui_internal.h"
#include "loadouts.h" #include "loadouts.h"
#include "sqlite3.h" #include "sqlite3.h"

View File

@ -12,7 +12,7 @@ std::vector<Tex> icons;
namespace Textures { namespace Textures {
constexpr int max_textures = 7; constexpr int max_textures = 7;
static bool Create(unsigned char *data, GLint format, Tex &texture) { static bool Create(unsigned char *data, GLint format, Tex &texture) {
// Create a OpenGL texture identifier // Create a OpenGL texture identifier
glGenTextures(1, &texture.id); glGenTextures(1, &texture.id);
glBindTexture(GL_TEXTURE_2D, texture.id); glBindTexture(GL_TEXTURE_2D, texture.id);
@ -22,6 +22,9 @@ namespace Textures {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Upload pixels into texture // Upload pixels into texture
#if defined(GL_UNPACK_ROW_LENGTH) && !defined(__EMSCRIPTEN__)
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
#endif
glTexImage2D(GL_TEXTURE_2D, 0, format, texture.width, texture.height, 0, format, GL_UNSIGNED_BYTE, data); glTexImage2D(GL_TEXTURE_2D, 0, format, texture.width, texture.height, 0, format, GL_UNSIGNED_BYTE, data);
return true; return true;
} }