mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 11:57:00 +00:00
CI: Extra warnings for builds with Clang. Backends: OpenGL3: Fix sign conversion warnings.
This commit is contained in:
parent
dc49b14e29
commit
5af8a8c7e8
@ -40,7 +40,10 @@ endif
|
|||||||
ifeq ($(UNAME_S), Linux) #LINUX
|
ifeq ($(UNAME_S), Linux) #LINUX
|
||||||
ECHO_MESSAGE = "Linux"
|
ECHO_MESSAGE = "Linux"
|
||||||
ifneq ($(WITH_EXTRA_WARNINGS), 0)
|
ifneq ($(WITH_EXTRA_WARNINGS), 0)
|
||||||
CXXFLAGS += -Wextra -pedantic
|
CXXFLAGS += -Wextra -Wpedantic
|
||||||
|
ifeq ($(shell $(CXX) -v 2>&1 | grep -c "clang version"), 1)
|
||||||
|
CXXFLAGS += -Wshadow -Wsign-conversion
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
CFLAGS = $(CXXFLAGS)
|
CFLAGS = $(CXXFLAGS)
|
||||||
endif
|
endif
|
||||||
@ -56,7 +59,7 @@ endif
|
|||||||
ifeq ($(findstring MINGW,$(UNAME_S)),MINGW)
|
ifeq ($(findstring MINGW,$(UNAME_S)),MINGW)
|
||||||
ECHO_MESSAGE = "MinGW"
|
ECHO_MESSAGE = "MinGW"
|
||||||
ifneq ($(WITH_EXTRA_WARNINGS), 0)
|
ifneq ($(WITH_EXTRA_WARNINGS), 0)
|
||||||
CXXFLAGS += -Wextra -pedantic
|
CXXFLAGS += -Wextra -Wpedantic
|
||||||
endif
|
endif
|
||||||
CFLAGS = $(CXXFLAGS)
|
CFLAGS = $(CXXFLAGS)
|
||||||
endif
|
endif
|
||||||
|
@ -132,8 +132,8 @@ static GLuint g_GlVersion = 0; // Extracted at runtime usin
|
|||||||
static char g_GlslVersionString[32] = ""; // Specified by user or detected based on compile time GL settings.
|
static char g_GlslVersionString[32] = ""; // Specified by user or detected based on compile time GL settings.
|
||||||
static GLuint g_FontTexture = 0;
|
static GLuint g_FontTexture = 0;
|
||||||
static GLuint g_ShaderHandle = 0, g_VertHandle = 0, g_FragHandle = 0;
|
static GLuint g_ShaderHandle = 0, g_VertHandle = 0, g_FragHandle = 0;
|
||||||
static int g_AttribLocationTex = 0, g_AttribLocationProjMtx = 0; // Uniforms location
|
static GLint g_AttribLocationTex = 0, g_AttribLocationProjMtx = 0; // Uniforms location
|
||||||
static int g_AttribLocationVtxPos = 0, g_AttribLocationVtxUV = 0, g_AttribLocationVtxColor = 0; // Vertex attributes location
|
static GLuint g_AttribLocationVtxPos = 0, g_AttribLocationVtxUV = 0, g_AttribLocationVtxColor = 0; // Vertex attributes location
|
||||||
static unsigned int g_VboHandle = 0, g_ElementsHandle = 0;
|
static unsigned int g_VboHandle = 0, g_ElementsHandle = 0;
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
@ -144,7 +144,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||||||
GLint major, minor;
|
GLint major, minor;
|
||||||
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
||||||
glGetIntegerv(GL_MINOR_VERSION, &minor);
|
glGetIntegerv(GL_MINOR_VERSION, &minor);
|
||||||
g_GlVersion = major * 100 + minor * 10;
|
g_GlVersion = (GLuint)(major * 100 + minor * 10);
|
||||||
#else
|
#else
|
||||||
g_GlVersion = 200; // GLES 2
|
g_GlVersion = 200; // GLES 2
|
||||||
#endif
|
#endif
|
||||||
@ -292,14 +292,14 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
// Backup GL state
|
// Backup GL state
|
||||||
GLenum last_active_texture; glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint*)&last_active_texture);
|
GLenum last_active_texture; glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint*)&last_active_texture);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
GLint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, &last_program);
|
GLuint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&last_program);
|
||||||
GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
|
GLuint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint*)&last_texture);
|
||||||
#ifdef GL_SAMPLER_BINDING
|
#ifdef GL_SAMPLER_BINDING
|
||||||
GLint last_sampler; glGetIntegerv(GL_SAMPLER_BINDING, &last_sampler);
|
GLuint last_sampler; glGetIntegerv(GL_SAMPLER_BINDING, (GLint*)&last_sampler);
|
||||||
#endif
|
#endif
|
||||||
GLint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
|
GLuint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, (GLint*)&last_array_buffer);
|
||||||
#ifndef IMGUI_IMPL_OPENGL_ES2
|
#ifndef IMGUI_IMPL_OPENGL_ES2
|
||||||
GLint last_vertex_array_object; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array_object);
|
GLuint last_vertex_array_object; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, (GLint*)&last_vertex_array_object);
|
||||||
#endif
|
#endif
|
||||||
#ifdef GL_POLYGON_MODE
|
#ifdef GL_POLYGON_MODE
|
||||||
GLint last_polygon_mode[2]; glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode);
|
GLint last_polygon_mode[2]; glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode);
|
||||||
@ -336,8 +336,8 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
||||||
|
|
||||||
// Upload vertex/index buffers
|
// Upload vertex/index buffers
|
||||||
glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)cmd_list->VtxBuffer.Size * sizeof(ImDrawVert), (const GLvoid*)cmd_list->VtxBuffer.Data, GL_STREAM_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)cmd_list->VtxBuffer.Size * (int)sizeof(ImDrawVert), (const GLvoid*)cmd_list->VtxBuffer.Data, GL_STREAM_DRAW);
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)cmd_list->IdxBuffer.Size * sizeof(ImDrawIdx), (const GLvoid*)cmd_list->IdxBuffer.Data, GL_STREAM_DRAW);
|
glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)cmd_list->IdxBuffer.Size * (int)sizeof(ImDrawIdx), (const GLvoid*)cmd_list->IdxBuffer.Data, GL_STREAM_DRAW);
|
||||||
|
|
||||||
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
|
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
|
||||||
{
|
{
|
||||||
@ -643,9 +643,9 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
|
|||||||
|
|
||||||
g_AttribLocationTex = glGetUniformLocation(g_ShaderHandle, "Texture");
|
g_AttribLocationTex = glGetUniformLocation(g_ShaderHandle, "Texture");
|
||||||
g_AttribLocationProjMtx = glGetUniformLocation(g_ShaderHandle, "ProjMtx");
|
g_AttribLocationProjMtx = glGetUniformLocation(g_ShaderHandle, "ProjMtx");
|
||||||
g_AttribLocationVtxPos = glGetAttribLocation(g_ShaderHandle, "Position");
|
g_AttribLocationVtxPos = (GLuint)glGetAttribLocation(g_ShaderHandle, "Position");
|
||||||
g_AttribLocationVtxUV = glGetAttribLocation(g_ShaderHandle, "UV");
|
g_AttribLocationVtxUV = (GLuint)glGetAttribLocation(g_ShaderHandle, "UV");
|
||||||
g_AttribLocationVtxColor = glGetAttribLocation(g_ShaderHandle, "Color");
|
g_AttribLocationVtxColor = (GLuint)glGetAttribLocation(g_ShaderHandle, "Color");
|
||||||
|
|
||||||
// Create buffers
|
// Create buffers
|
||||||
glGenBuffers(1, &g_VboHandle);
|
glGenBuffers(1, &g_VboHandle);
|
||||||
|
Loading…
Reference in New Issue
Block a user