mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Merge remote-tracking branch 'origin' into 2016-07-navigation
This commit is contained in:
		@@ -152,7 +152,6 @@ bool ImGui_ImplSdlGL3_ProcessEvent(SDL_Event* event)
 | 
			
		||||
        }
 | 
			
		||||
    case SDL_TEXTINPUT:
 | 
			
		||||
        {
 | 
			
		||||
            ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
            io.AddInputCharactersUTF8(event->text.text);
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -131,7 +131,6 @@ bool ImGui_ImplSdl_ProcessEvent(SDL_Event* event)
 | 
			
		||||
        }
 | 
			
		||||
    case SDL_TEXTINPUT:
 | 
			
		||||
        {
 | 
			
		||||
            ImGuiIO& io = ImGui::GetIO();
 | 
			
		||||
            io.AddInputCharactersUTF8(event->text.text);
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -1048,7 +1048,6 @@ ImU32 ImHash(const void* data, int data_size, ImU32 seed)
 | 
			
		||||
            // - We don't do 'current += 2; continue;' after handling ### to keep the code smaller.
 | 
			
		||||
            if (c == '#' && current[0] == '#' && current[1] == '#')
 | 
			
		||||
                crc = seed;
 | 
			
		||||
 | 
			
		||||
            crc = (crc >> 8) ^ crc32_lut[(crc & 0xFF) ^ c];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -1351,7 +1350,7 @@ void ImGuiStorage::Clear()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// std::lower_bound but without the bullshit
 | 
			
		||||
static ImVector<ImGuiStorage::Pair>::iterator LowerBound(ImVector<ImGuiStorage::Pair>& data, ImU32 key)
 | 
			
		||||
static ImVector<ImGuiStorage::Pair>::iterator LowerBound(ImVector<ImGuiStorage::Pair>& data, ImGuiID key)
 | 
			
		||||
{
 | 
			
		||||
    ImVector<ImGuiStorage::Pair>::iterator first = data.begin();
 | 
			
		||||
    ImVector<ImGuiStorage::Pair>::iterator last = data.end();
 | 
			
		||||
@@ -1373,7 +1372,7 @@ static ImVector<ImGuiStorage::Pair>::iterator LowerBound(ImVector<ImGuiStorage::
 | 
			
		||||
    return first;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ImGuiStorage::GetInt(ImU32 key, int default_val) const
 | 
			
		||||
int ImGuiStorage::GetInt(ImGuiID key, int default_val) const
 | 
			
		||||
{
 | 
			
		||||
    ImVector<Pair>::iterator it = LowerBound(const_cast<ImVector<ImGuiStorage::Pair>&>(Data), key);
 | 
			
		||||
    if (it == Data.end() || it->key != key)
 | 
			
		||||
@@ -1381,12 +1380,12 @@ int ImGuiStorage::GetInt(ImU32 key, int default_val) const
 | 
			
		||||
    return it->val_i;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool ImGuiStorage::GetBool(ImU32 key, bool default_val) const
 | 
			
		||||
bool ImGuiStorage::GetBool(ImGuiID key, bool default_val) const
 | 
			
		||||
{
 | 
			
		||||
    return GetInt(key, default_val ? 1 : 0) != 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
float ImGuiStorage::GetFloat(ImU32 key, float default_val) const
 | 
			
		||||
float ImGuiStorage::GetFloat(ImGuiID key, float default_val) const
 | 
			
		||||
{
 | 
			
		||||
    ImVector<Pair>::iterator it = LowerBound(const_cast<ImVector<ImGuiStorage::Pair>&>(Data), key);
 | 
			
		||||
    if (it == Data.end() || it->key != key)
 | 
			
		||||
@@ -1433,7 +1432,7 @@ void** ImGuiStorage::GetVoidPtrRef(ImGuiID key, void* default_val)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)
 | 
			
		||||
void ImGuiStorage::SetInt(ImU32 key, int val)
 | 
			
		||||
void ImGuiStorage::SetInt(ImGuiID key, int val)
 | 
			
		||||
{
 | 
			
		||||
    ImVector<Pair>::iterator it = LowerBound(Data, key);
 | 
			
		||||
    if (it == Data.end() || it->key != key)
 | 
			
		||||
@@ -1444,12 +1443,12 @@ void ImGuiStorage::SetInt(ImU32 key, int val)
 | 
			
		||||
    it->val_i = val;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImGuiStorage::SetBool(ImU32 key, bool val)
 | 
			
		||||
void ImGuiStorage::SetBool(ImGuiID key, bool val)
 | 
			
		||||
{
 | 
			
		||||
    SetInt(key, val ? 1 : 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImGuiStorage::SetFloat(ImU32 key, float val)
 | 
			
		||||
void ImGuiStorage::SetFloat(ImGuiID key, float val)
 | 
			
		||||
{
 | 
			
		||||
    ImVector<Pair>::iterator it = LowerBound(Data, key);
 | 
			
		||||
    if (it == Data.end() || it->key != key)
 | 
			
		||||
@@ -1460,7 +1459,7 @@ void ImGuiStorage::SetFloat(ImU32 key, float val)
 | 
			
		||||
    it->val_f = val;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ImGuiStorage::SetVoidPtr(ImU32 key, void* val)
 | 
			
		||||
void ImGuiStorage::SetVoidPtr(ImGuiID key, void* val)
 | 
			
		||||
{
 | 
			
		||||
    ImVector<Pair>::iterator it = LowerBound(Data, key);
 | 
			
		||||
    if (it == Data.end() || it->key != key)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								imgui.h
									
									
									
									
									
								
							@@ -62,11 +62,11 @@ struct ImGuiSizeConstraintCallbackData;// Structure used to constraint window si
 | 
			
		||||
struct ImGuiListClipper;            // Helper to manually clip large list of items
 | 
			
		||||
struct ImGuiContext;                // ImGui context (opaque)
 | 
			
		||||
 | 
			
		||||
// Enumerations (declared as int for compatibility and to not pollute the top of this file)
 | 
			
		||||
typedef unsigned int ImU32;
 | 
			
		||||
// Typedefs and Enumerations (declared as int for compatibility and to not pollute the top of this file)
 | 
			
		||||
typedef unsigned int ImU32;         // 32-bit unsigned integer (typically used to store packed colors)
 | 
			
		||||
typedef unsigned int ImGuiID;       // unique ID used by widgets (typically hashed from a stack of string)
 | 
			
		||||
typedef unsigned short ImWchar;     // character for keyboard input/display
 | 
			
		||||
typedef void* ImTextureID;          // user data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
 | 
			
		||||
typedef ImU32 ImGuiID;              // unique ID used by widgets (typically hashed from a stack of string)
 | 
			
		||||
typedef int ImGuiCol;               // a color identifier for styling       // enum ImGuiCol_
 | 
			
		||||
typedef int ImGuiStyleVar;          // a variable identifier for styling    // enum ImGuiStyleVar_
 | 
			
		||||
typedef int ImGuiKey;               // a key identifier (ImGui-side enum)   // enum ImGuiKey_
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user