Merge branch 'master' into viewport

# Conflicts:
#	examples/opengl2_example/imgui_impl_glfw_gl2.cpp
#	examples/opengl3_example/imgui_impl_glfw_gl3.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp
#	examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h
#	examples/vulkan_example/imgui_impl_glfw_vulkan.cpp
This commit is contained in:
omar
2018-05-25 12:44:56 +02:00
13 changed files with 188 additions and 164 deletions

View File

@ -8,11 +8,9 @@
#import "imgui_impl_ios.h"
#import "debug_hud.h"
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
#define SERVERNAME_KEY @"ServerName"
#define SERVERNAME_ALERT_TAG (10)
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
#define SERVERNAME_KEY @"ServerName"
#define SERVERNAME_ALERT_TAG 10
// Uniform index.
enum
@ -20,85 +18,80 @@ enum
UNIFORM_MODELVIEWPROJECTION_MATRIX,
UNIFORM_NORMAL_MATRIX,
UNIFORM_DIFFUSE_COLOR,
NUM_UNIFORMS
UNIFORM_COUNT_
};
GLint uniforms[NUM_UNIFORMS];
static GLint uniforms[UNIFORM_COUNT_];
// Attribute index.
enum
{
ATTRIB_VERTEX,
ATTRIB_NORMAL,
NUM_ATTRIBUTES
ATTRIB_COUNT_
};
GLfloat gCubeVertexData[216] =
static const GLfloat gCubeVertexData[216] =
{
// Data layout for each line below is:
// positionX, positionY, positionZ, normalX, normalY, normalZ,
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
// pos x/y/z, normal x/y/z,
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
0.5f, 0.5f, -0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5f, 0.0f, 0.0f, -1.0f,
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f
0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
-0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f
};
@interface GameViewController () <UIAlertViewDelegate>
{
GLuint _program;
GLKMatrix4 _modelViewProjectionMatrix;
GLKMatrix3 _normalMatrix;
float _rotation;
GLuint _vertexArray;
GLuint _vertexBuffer;
DebugHUD _hud;
GLuint _program;
GLKMatrix4 _modelViewProjectionMatrix;
GLKMatrix3 _normalMatrix;
float _rotation;
GLuint _vertexArray;
GLuint _vertexBuffer;
DebugHUD _hud;
}
@property (strong, nonatomic) EAGLContext *context;
@property (strong, nonatomic) GLKBaseEffect *effect;
@property (strong, nonatomic) ImGuiHelper *imgui;
@property (weak, nonatomic) IBOutlet UIButton *btnServername;
@property (strong, nonatomic) NSString *serverName;
@property (strong, nonatomic) EAGLContext* context;
@property (strong, nonatomic) GLKBaseEffect* effect;
@property (strong, nonatomic) ImGuiHelper* imgui;
@property (weak, nonatomic) IBOutlet UIButton* btnServername;
@property (strong, nonatomic) NSString* serverName;
- (IBAction)onServernameTapped:(id)sender;
@ -106,7 +99,7 @@ GLfloat gCubeVertexData[216] =
- (void)tearDownGL;
- (BOOL)loadShaders;
- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file;
- (BOOL)compileShader:(GLuint*)shader type:(GLenum)type file:(NSString*)file;
- (BOOL)linkProgram:(GLuint)prog;
- (BOOL)validateProgram:(GLuint)prog;
@end
@ -119,9 +112,8 @@ GLfloat gCubeVertexData[216] =
self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
if (!self.context) {
if (!self.context)
NSLog(@"Failed to create ES context");
}
GLKView *view = (GLKView *)self.view;
view.context = self.context;
@ -140,30 +132,29 @@ GLfloat gCubeVertexData[216] =
[self.imgui connectServer: self.serverName ];
}
DebugHUD_InitDefaults( &_hud );
DebugHUD_InitDefaults(&_hud);
}
- (void)dealloc
{
[self tearDownGL];
if ([EAGLContext currentContext] == self.context) {
if ([EAGLContext currentContext] == self.context)
[EAGLContext setCurrentContext:nil];
}
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
if ([self isViewLoaded] && ([[self view] window] == nil)) {
if ([self isViewLoaded] && ([[self view] window] == nil))
{
self.view = nil;
[self tearDownGL];
if ([EAGLContext currentContext] == self.context) {
if ([EAGLContext currentContext] == self.context)
[EAGLContext setCurrentContext:nil];
}
self.context = nil;
}
@ -171,7 +162,8 @@ GLfloat gCubeVertexData[216] =
}
- (BOOL)prefersStatusBarHidden {
- (BOOL)prefersStatusBarHidden
{
return YES;
}
@ -185,7 +177,7 @@ GLfloat gCubeVertexData[216] =
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if ((buttonIndex==0)&&(alertView.tag==SERVERNAME_ALERT_TAG))
if ((buttonIndex==0) && (alertView.tag == SERVERNAME_ALERT_TAG))
{
// This is really janky. I usually just hardcode the servername since I'm building it anyway.
// If you want to properly handle updating the server, you'll want to tear down and recreate
@ -193,7 +185,8 @@ GLfloat gCubeVertexData[216] =
BOOL serverNameWasSet = self.serverName.length > 0;
NSString *serverName = [[alertView textFieldAtIndex:0] text];
if ([serverName length] > 0) {
if ([serverName length] > 0)
{
self.serverName = serverName;
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:serverName forKey:SERVERNAME_KEY ];
@ -202,7 +195,8 @@ GLfloat gCubeVertexData[216] =
[self.btnServername setTitle:self.serverName forState:UIControlStateNormal];
// If we hadn't previously connected, try now
if (!serverNameWasSet) {
if (!serverNameWasSet)
{
[self.imgui connectServer:self.serverName];
}
else
@ -241,8 +235,6 @@ GLfloat gCubeVertexData[216] =
glVertexAttribPointer(GLKVertexAttribNormal, 3, GL_FLOAT, GL_FALSE, 24, BUFFER_OFFSET(12));
glBindVertexArrayOES(0);
}
- (void)tearDownGL
@ -254,7 +246,8 @@ GLfloat gCubeVertexData[216] =
self.effect = nil;
if (_program) {
if (_program)
{
glDeleteProgram(_program);
_program = 0;
}
@ -285,9 +278,7 @@ GLfloat gCubeVertexData[216] =
modelViewMatrix = GLKMatrix4Multiply(baseModelViewMatrix, modelViewMatrix);
_normalMatrix = GLKMatrix3InvertAndTranspose(GLKMatrix4GetMatrix3(modelViewMatrix), NULL);
_modelViewProjectionMatrix = GLKMatrix4Multiply(projectionMatrix, modelViewMatrix);
_rotation += self.timeSinceLastUpdate * (_hud.rotation_speed * (M_PI / 180.0));
}
@ -359,7 +350,8 @@ GLfloat gCubeVertexData[216] =
glBindAttribLocation(_program, GLKVertexAttribNormal, "normal");
// Link program.
if (![self linkProgram:_program]) {
if (![self linkProgram:_program])
{
NSLog(@"Failed to link program: %d", _program);
if (vertShader) {
@ -384,11 +376,13 @@ GLfloat gCubeVertexData[216] =
uniforms[UNIFORM_DIFFUSE_COLOR] = glGetUniformLocation(_program, "diffuseColor");
// Release vertex and fragment shaders.
if (vertShader) {
if (vertShader)
{
glDetachShader(_program, vertShader);
glDeleteShader(vertShader);
}
if (fragShader) {
if (fragShader)
{
glDetachShader(_program, fragShader);
glDeleteShader(fragShader);
}
@ -402,7 +396,8 @@ GLfloat gCubeVertexData[216] =
const GLchar *source;
source = (GLchar *)[[NSString stringWithContentsOfFile:file encoding:NSUTF8StringEncoding error:nil] UTF8String];
if (!source) {
if (!source)
{
NSLog(@"Failed to load vertex shader");
return NO;
}
@ -423,7 +418,8 @@ GLfloat gCubeVertexData[216] =
#endif
glGetShaderiv(*shader, GL_COMPILE_STATUS, &status);
if (status == 0) {
if (status == 0)
{
glDeleteShader(*shader);
return NO;
}
@ -439,7 +435,8 @@ GLfloat gCubeVertexData[216] =
#if defined(DEBUG)
GLint logLength;
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0) {
if (logLength > 0)
{
GLchar *log = (GLchar *)malloc(logLength);
glGetProgramInfoLog(prog, logLength, &logLength, log);
NSLog(@"Program link log:\n%s", log);
@ -448,10 +445,8 @@ GLfloat gCubeVertexData[216] =
#endif
glGetProgramiv(prog, GL_LINK_STATUS, &status);
if (status == 0) {
if (status == 0)
return NO;
}
return YES;
}
@ -469,10 +464,8 @@ GLfloat gCubeVertexData[216] =
}
glGetProgramiv(prog, GL_VALIDATE_STATUS, &status);
if (status == 0) {
if (status == 0)
return NO;
}
return YES;
}

View File

@ -6,12 +6,12 @@
typedef struct DebugHUD
{
bool show_demo_window;
bool show_another_window;
float rotation_speed;
float cubeColor1[4];
float cubeColor2[4];
float clearColor[4];
bool show_demo_window;
bool show_another_window;
float rotation_speed;
float cubeColor1[4];
float cubeColor2[4];
float clearColor[4];
} DebugHUD;
#if __cplusplus

View File

@ -277,8 +277,7 @@ void ImGui_KeyboardCallback(uSynergyCookie cookie, uint16_t key,
// If this key maps to a character input, apply it
int charForKeycode = (modifiers & USYNERGY_MODIFIER_SHIFT) ? g_keycodeCharShifted[scanCode] : g_keycodeCharUnshifted[scanCode];
io.AddInputCharacter((unsigned short)charForKeycode);
}
}
}
void ImGui_JoystickCallback(uSynergyCookie cookie, uint8_t joyNum, uint16_t buttons, int8_t leftStickX, int8_t leftStickY, int8_t rightStickX, int8_t rightStickY)
@ -461,14 +460,15 @@ void ImGui_ClipboardCallback(uSynergyCookie cookie, enum uSynergyClipboardFormat
- (void)setupImGuiHooks
{
ImGuiIO &io = ImGui::GetIO();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
[self setupKeymaps];
// Account for retina display for glScissor
g_displayScale = [[UIScreen mainScreen] scale];
ImGuiStyle &style = ImGui::GetStyle();
ImGuiStyle& style = ImGui::GetStyle();
style.TouchExtraPadding = ImVec2( 4.0, 4.0 );
io.RenderDrawListsFn = ImGui_ImplIOS_RenderDrawLists;
@ -532,9 +532,8 @@ void ImGui_ClipboardCallback(uSynergyCookie cookie, enum uSynergyClipboardFormat
// Create a background thread for synergy
_synergyQueue = dispatch_queue_create( "imgui-usynergy", NULL );
dispatch_async( _synergyQueue, ^{
while (1) {
uSynergyUpdate( &_synergyCtx );
}
while (1)
uSynergyUpdate(&_synergyCtx);
});
}
@ -569,24 +568,20 @@ void ImGui_ClipboardCallback(uSynergyCookie cookie, enum uSynergyClipboardFormat
- (void)newFrame
{
ImGuiIO& io = ImGui::GetIO();
ImGuiStyle &style = ImGui::GetStyle();
ImGuiStyle& style = ImGui::GetStyle();
if (!g_FontTexture)
{
ImGui_ImplIOS_CreateDeviceObjects();
}
io.DisplaySize = ImVec2( _view.bounds.size.width, _view.bounds.size.height );
io.DisplaySize = ImVec2(_view.bounds.size.width, _view.bounds.size.height);
io.MouseDrawCursor = g_synergyPtrActive;
if (g_synergyPtrActive)
{
style.TouchExtraPadding = ImVec2( 0.0, 0.0 );
io.MousePos = ImVec2( g_mousePosX, g_mousePosY );
style.TouchExtraPadding = ImVec2(0.0, 0.0);
io.MousePos = ImVec2(g_mousePosX, g_mousePosY);
for (int i=0; i < 3; i++)
{
io.MouseDown[i] = g_MousePressed[i];
}
// This is an arbitrary scaling factor that works for me. Not sure what units these mousewheel values from synergy are supposed to be in.
io.MouseWheel = g_mouseWheelY / 500.0;
@ -595,8 +590,8 @@ void ImGui_ClipboardCallback(uSynergyCookie cookie, enum uSynergyClipboardFormat
else
{
// Synergy not active, use touch events
style.TouchExtraPadding = ImVec2( 4.0, 4.0 );
io.MousePos = ImVec2(_touchPos.x, _touchPos.y );
style.TouchExtraPadding = ImVec2(4.0, 4.0);
io.MousePos = ImVec2(_touchPos.x, _touchPos.y);
if ((_mouseDown) || (_mouseTapped))
{
io.MouseDown[0] = true;

View File

@ -50,7 +50,7 @@ enum GlfwClientApi
};
static GLFWwindow* g_Window = NULL;
static GlfwClientApi g_ClientApi = GlfwClientApi_Unknown;
static double g_Time = 0.0f;
static double g_Time = 0.0;
static bool g_MouseJustPressed[5] = { false, false, false, false, false };
static GLFWcursor* g_MouseCursors[ImGuiMouseCursor_Count_] = { 0 };
static bool g_WantUpdateMonitors = true;
@ -116,6 +116,7 @@ void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window)
static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, GlfwClientApi client_api)
{
g_Window = window;
g_Time = 0.0;
// Setup back-end capabilities flags
ImGuiIO& io = ImGui::GetIO();

View File

@ -11,6 +11,10 @@
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
// About GLSL version:
// The 'glsl_version' initialization parameter defaults to "#version 150" if NULL.
// Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure!
struct GLFWwindow;
IMGUI_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks);

View File

@ -10,6 +10,7 @@
// (minor and older changes stripped away, please see git history for details)
// 2018-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2018-XX-XX: OpenGL: Offset projection matrix and clipping rectangle by draw_data->DisplayPos (which will be non-zero for multi-viewport applications).
// 2018-05-25: OpenGL: Removed unnecessary backup/restore of GL_ELEMENT_ARRAY_BUFFER_BINDING since this is part of the VAO state.
// 2018-05-14: OpenGL: Making the call to glBindSampler() optional so 3.2 context won't fail if the function is a NULL pointer.
// 2018-03-06: OpenGL: Added const char* glsl_version parameter to ImGui_ImplOpenGL3_Init() so user can override the GLSL version e.g. "#version 150".
// 2018-02-23: OpenGL: Create the VAO in the render function so the setup can more easily be used with multiple shared GL context.
@ -44,7 +45,7 @@ static void ImGui_ImplOpenGL3_ShutdownPlatformInterface();
// Functions
bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
{
// Store GL version string so we can refer to it later in case we recreate shaders.
// Store GLSL version string so we can refer to it later in case we recreate shaders. Note: GLSL version is NOT the same as GL version. Leave this to NULL if unsure.
if (glsl_version == NULL)
glsl_version = "#version 150";
IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(g_GlslVersion));
@ -91,7 +92,6 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
GLint last_sampler; glGetIntegerv(GL_SAMPLER_BINDING, &last_sampler);
GLint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
GLint last_element_array_buffer; glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &last_element_array_buffer);
GLint last_vertex_array; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array);
GLint last_polygon_mode[2]; glGetIntegerv(GL_POLYGON_MODE, last_polygon_mode);
GLint last_viewport[4]; glGetIntegerv(GL_VIEWPORT, last_viewport);
@ -194,7 +194,6 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
glActiveTexture(last_active_texture);
glBindVertexArray(last_vertex_array);
glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, last_element_array_buffer);
glBlendEquationSeparate(last_blend_equation_rgb, last_blend_equation_alpha);
glBlendFuncSeparate(last_blend_src_rgb, last_blend_dst_rgb, last_blend_src_alpha, last_blend_dst_alpha);
if (last_enable_blend) glEnable(GL_BLEND); else glDisable(GL_BLEND);

View File

@ -6,7 +6,11 @@
// [X] User texture binding. Use 'GLUint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp.
// [X] Multi-viewport rendering (when ImGuiConfigFlags_ViewportsEnable is enabled).
IMGUI_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
// About GLSL version:
// The 'glsl_version' initialization parameter defaults to "#version 150" if NULL.
// Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure!
IMGUI_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = "#version 150");
IMGUI_API void ImGui_ImplOpenGL3_Shutdown();
IMGUI_API void ImGui_ImplOpenGL3_NewFrame();
IMGUI_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);