Apple: Fixed example_osx_opengl2, renamed to example_apple_opengl2 + misc comments

This commit is contained in:
Omar Cornut
2018-07-08 10:47:31 +02:00
parent d64157e803
commit c3f9220c15
8 changed files with 32 additions and 15 deletions

View File

@ -113,7 +113,8 @@ List of Renderer Bindings in this repository:
imgui_impl_dx9.cpp ; DirectX9
imgui_impl_dx10.cpp ; DirectX10
imgui_impl_dx11.cpp ; DirectX11
imgui_impl_dx12.cpp ; DirectX12
imgui_impl_dx12.cpp ; DirectX12
imgui_impl_metal.mm ; Metal (with ObjC)
imgui_impl_opengl2.cpp ; OpenGL2 (legacy, fixed pipeline <- don't use with modern OpenGL context)
imgui_impl_opengl3.cpp ; OpenGL3 (modern programmable pipeline)
imgui_impl_vulkan.cpp ; Vulkan
@ -144,6 +145,7 @@ Building:
- Makefiles for Linux/OSX
- Batch files for Visual Studio 2008+
- A .sln project file for Visual Studio 2010+
- Xcode project files for the Apple examples
Please let me know if they don't work with your setup!
You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those
directly with a command-line compiler.
@ -208,7 +210,12 @@ example_sdl_vulkan/
This is quite long and tedious, because: Vulkan.
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_vulkan.cpp
example_osx_opengl2/
example_apple_metal/
OSX & iOS + Metal.
It is based on the cross-platform game template provided with Xcode as of Xcode 9.
= game template + imgui_impl_osx.mm + imgui_impl_metal.mm
example_apple_opengl2/
OSX Cocoa + OpenGL2.
= main.mm + imgui_impl_osx.mm + imgui_impl_opengl2.cpp

View File

@ -144,12 +144,12 @@
}
// Forward Mouse/Keyboard events to dear imgui OSX back-end. It returns true when imgui is expecting to use the event.
-(void)keyUp:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event); }
-(void)keyDown:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event); }
-(void)flagsChanged:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event); }
-(void)mouseDown:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event); }
-(void)mouseUp:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event); }
-(void)scrollWheel:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event); }
-(void)keyUp:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event, self); }
-(void)keyDown:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event, self); }
-(void)flagsChanged:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event, self); }
-(void)mouseDown:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event, self); }
-(void)mouseUp:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event, self); }
-(void)scrollWheel:(NSEvent *)event { ImGui_ImplOSX_HandleEvent(event, self); }
@end

View File

@ -10,7 +10,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-07-05: Metal: Added new Metal backend implementation
// 2018-07-05: Metal: Added new Metal backend implementation.
#include "imgui.h"
#include "imgui_impl_metal.h"

View File

@ -1,5 +1,10 @@
// ImGui Platform Binding for: OSX / Cocoa
// This needs to be used along with a Renderer (e.g. OpenGL2, OpenGL3, Vulkan, Metal..)
// [BETA] Beta bindings, not well tested. If you want a portable application, prefer using the Glfw or SDL platform bindings on Mac.
// Issues:
// [ ] Platform: Keys are all generally very broken. Best using [event keycode] and not [event characters]..
// [ ] Platform: Mouse cursor shapes and visibility are not supported (see end of https://github.com/glfw/glfw/issues/427)
@class NSEvent;
@class NSView;

View File

@ -1,10 +1,10 @@
// ImGui Platform Binding for: OSX / Cocoa
// This needs to be used along with a Renderer (e.g. OpenGL2, OpenGL3, Vulkan, Metal..)
// [BETA] Beta bindings, not well tested. If you want a portable application, prefer using the Glfw or SDL platform bindings on Mac.
// Issues:
// [ ] Platform: Keys are all generally very broken. Best using [event keycode] and not [event characters]..
// [ ] Platform: Mouse cursor shapes are not supported (see end of https://github.com/glfw/glfw/issues/427)
// [ ] Test with another renderer back-end than OpenGL2. e.g. OpenGL3.
// [ ] Platform: Mouse cursor shapes and visibility are not supported (see end of https://github.com/glfw/glfw/issues/427)
#include "imgui.h"
#include "imgui_impl_osx.h"
@ -12,7 +12,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2018-06-XX: Initial version.
// 2018-07-07: Initial version.
// Data
static clock_t g_Time = 0;