Skip to content

Commit

Permalink
Got rid of IM_VEC2_CLASS_EXTRA and IM_VEC4_CLASS_EXTRA
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Geilfus committed Sep 23, 2014
1 parent fd235d1 commit 16e330c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
14 changes: 7 additions & 7 deletions src/ImGuiCinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace ImGui {
void mouseDown( ci::app::MouseEvent& event )
{
ImGuiIO& io = ImGui::GetIO();
io.MousePos = ImVec2( event.getPos() );
io.MousePos = ImVec2( event.getPos().x, event.getPos().y );
if( event.isLeftDown() ){
io.MouseDown[0] = true;
io.MouseDown[1] = false;
Expand All @@ -49,15 +49,15 @@ namespace ImGui {
void mouseMove( ci::app::MouseEvent& event )
{
ImGuiIO& io = ImGui::GetIO();
io.MousePos = ImVec2( event.getPos() );
io.MousePos = ImVec2( event.getPos().x, event.getPos().y );

event.setHandled( io.WantCaptureMouse );
}
//! sets the right mouseDrag IO values in imgui
void mouseDrag( ci::app::MouseEvent& event )
{
ImGuiIO& io = ImGui::GetIO();
io.MousePos = ImVec2( event.getPos() );
io.MousePos = ImVec2( event.getPos().x, event.getPos().y );

event.setHandled( io.WantCaptureMouse );
}
Expand Down Expand Up @@ -115,7 +115,7 @@ namespace ImGui {
void setSize( ci::ivec2 size )
{
ImGuiIO& io = ImGui::GetIO();
io.DisplaySize = vec2( size );
io.DisplaySize = ImVec2( size.x, size.y );
}

//! connects window signals to imgui events
Expand All @@ -133,7 +133,7 @@ namespace ImGui {
} );

ImGuiIO& io = ImGui::GetIO();
io.DisplaySize = ImVec2( window->getSize() );
io.DisplaySize = ImVec2( window->getSize().x, window->getSize().y );
io.DeltaTime = 1.0f / 60.0f;
io.KeyMap[ImGuiKey_Tab] = KeyEvent::KEY_TAB;
io.KeyMap[ImGuiKey_LeftArrow] = KeyEvent::KEY_LEFT;
Expand Down Expand Up @@ -298,8 +298,8 @@ namespace ImGui {
uint32_t r = color >> 0 & 255;

RenderData d;
d.pos = vec2( cmd_list->vtx_buffer[i].pos );
d.uv = vec2( cmd_list->vtx_buffer[i].uv );
d.pos = vec2( cmd_list->vtx_buffer[i].pos.x, cmd_list->vtx_buffer[i].pos.y );
d.uv = vec2( cmd_list->vtx_buffer[i].uv.x, cmd_list->vtx_buffer[i].uv.y );
d.color = vec4( r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f );
*data = d;
++data;
Expand Down
11 changes: 0 additions & 11 deletions src/ImGuiCinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@

#include <memory>

// this would usually be in imguicondig.h but it is easier
// to leave it here so we don't need to modify the library
#define IM_VEC2_CLASS_EXTRA \
ImVec2(const ci::vec2& f) { x = f.x; y = f.y; } \
operator ci::vec2() const { return ci::vec2(x,y); }

#define IM_VEC4_CLASS_EXTRA \
ImVec4(const ci::vec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; } \
operator ci::vec4() const { return ci::vec4(x,y,z,w); }


#include "imgui.h"

#include "cinder/DataSource.h"
Expand Down

0 comments on commit 16e330c

Please sign in to comment.