Browse Source

Converted all Tabs to Spaces (git diff -w shows an empty diff)

ocornut 11 years ago
parent
commit
42d4b4be6a
5 changed files with 1587 additions and 1587 deletions
  1. 246 246
      examples/directx9_example/main.cpp
  2. 204 204
      examples/opengl_example/main.cpp
  3. 12 12
      imconfig.h
  4. 640 640
      imgui.cpp
  5. 485 485
      imgui.h

+ 246 - 246
examples/directx9_example/main.cpp

@@ -5,98 +5,98 @@
 #include <dinput.h>
 #include <dinput.h>
 #include "../../imgui.h"
 #include "../../imgui.h"
 
 
-#pragma warning (disable: 4996)		// 'This function or variable may be unsafe': strdup
+#pragma warning (disable: 4996)     // 'This function or variable may be unsafe': strdup
 
 
 static HWND hWnd;
 static HWND hWnd;
-static LPDIRECT3D9             g_pD3D = NULL;		// Used to create the D3DDevice
+static LPDIRECT3D9             g_pD3D = NULL;       // Used to create the D3DDevice
 static LPDIRECT3DDEVICE9       g_pd3dDevice = NULL; // Our rendering device
 static LPDIRECT3DDEVICE9       g_pd3dDevice = NULL; // Our rendering device
-static LPDIRECT3DVERTEXBUFFER9 g_pVB = NULL;		// Buffer to hold vertices
-static LPDIRECT3DTEXTURE9      g_pTexture = NULL;	// Our texture
+static LPDIRECT3DVERTEXBUFFER9 g_pVB = NULL;        // Buffer to hold vertices
+static LPDIRECT3DTEXTURE9      g_pTexture = NULL;   // Our texture
 struct CUSTOMVERTEX
 struct CUSTOMVERTEX
 {
 {
-    D3DXVECTOR3	position;
-    D3DCOLOR	color;
-    float		tu, tv;
+    D3DXVECTOR3 position;
+    D3DCOLOR    color;
+    float       tu, tv;
 };
 };
 #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
 #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
 
 
 // This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structuer)
 // This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structuer)
 static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count)
 static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count)
 {
 {
-	size_t total_vtx_count = 0;
-	for (int n = 0; n < cmd_lists_count; n++)
-		total_vtx_count += cmd_lists[n]->vtx_buffer.size();
-	if (total_vtx_count == 0)
-		return;
+    size_t total_vtx_count = 0;
+    for (int n = 0; n < cmd_lists_count; n++)
+        total_vtx_count += cmd_lists[n]->vtx_buffer.size();
+    if (total_vtx_count == 0)
+        return;
 
 
-	// Copy and convert all vertices into a single contiguous buffer
+    // Copy and convert all vertices into a single contiguous buffer
     CUSTOMVERTEX* vtx_dst;
     CUSTOMVERTEX* vtx_dst;
     if (g_pVB->Lock(0, total_vtx_count, (void**)&vtx_dst, D3DLOCK_DISCARD) < 0)
     if (g_pVB->Lock(0, total_vtx_count, (void**)&vtx_dst, D3DLOCK_DISCARD) < 0)
         return;
         return;
-	for (int n = 0; n < cmd_lists_count; n++)
-	{
-		const ImDrawList* cmd_list = cmd_lists[n];
-		const ImDrawVert* vtx_src = &cmd_list->vtx_buffer[0];
-		for (size_t i = 0; i < cmd_list->vtx_buffer.size(); i++)
-		{
-			vtx_dst->position.x = vtx_src->pos.x;
-			vtx_dst->position.y = vtx_src->pos.y;
-			vtx_dst->position.z = 0.0f;
-			vtx_dst->color = (vtx_src->col & 0xFF00FF00) | ((vtx_src->col & 0xFF0000)>>16) | ((vtx_src->col & 0xFF) << 16);		// RGBA --> ARGB for DirectX9
-			vtx_dst->tu = vtx_src->uv.x;
-			vtx_dst->tv = vtx_src->uv.y;
-			vtx_dst++;
-			vtx_src++;
-		}
-	}
+    for (int n = 0; n < cmd_lists_count; n++)
+    {
+        const ImDrawList* cmd_list = cmd_lists[n];
+        const ImDrawVert* vtx_src = &cmd_list->vtx_buffer[0];
+        for (size_t i = 0; i < cmd_list->vtx_buffer.size(); i++)
+        {
+            vtx_dst->position.x = vtx_src->pos.x;
+            vtx_dst->position.y = vtx_src->pos.y;
+            vtx_dst->position.z = 0.0f;
+            vtx_dst->color = (vtx_src->col & 0xFF00FF00) | ((vtx_src->col & 0xFF0000)>>16) | ((vtx_src->col & 0xFF) << 16);     // RGBA --> ARGB for DirectX9
+            vtx_dst->tu = vtx_src->uv.x;
+            vtx_dst->tv = vtx_src->uv.y;
+            vtx_dst++;
+            vtx_src++;
+        }
+    }
     g_pVB->Unlock();
     g_pVB->Unlock();
 
 
-	g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof( CUSTOMVERTEX ) );
-	g_pd3dDevice->SetFVF( D3DFVF_CUSTOMVERTEX );
+    g_pd3dDevice->SetStreamSource( 0, g_pVB, 0, sizeof( CUSTOMVERTEX ) );
+    g_pd3dDevice->SetFVF( D3DFVF_CUSTOMVERTEX );
 
 
-	// Setup render state: alpha-blending, no face culling, no depth testing
+    // Setup render state: alpha-blending, no face culling, no depth testing
     g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
     g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
     g_pd3dDevice->SetRenderState( D3DRS_LIGHTING, false );
     g_pd3dDevice->SetRenderState( D3DRS_LIGHTING, false );
     g_pd3dDevice->SetRenderState( D3DRS_ZENABLE, false );
     g_pd3dDevice->SetRenderState( D3DRS_ZENABLE, false );
-	g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
-	g_pd3dDevice->SetRenderState( D3DRS_BLENDOP, D3DBLENDOP_ADD );
-	g_pd3dDevice->SetRenderState( D3DRS_ALPHATESTENABLE, false );
-	g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
-	g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
-	g_pd3dDevice->SetRenderState( D3DRS_SCISSORTESTENABLE, true );
-
-	// Setup texture
-	g_pd3dDevice->SetTexture( 0, g_pTexture );
-	g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
-	g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
-	g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
-	g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
-	g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
-	g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
-
-	// Setup orthographic projection matrix
-	D3DXMATRIXA16 mat;
-	D3DXMatrixIdentity(&mat);
-	g_pd3dDevice->SetTransform(D3DTS_WORLD, &mat);
-	g_pd3dDevice->SetTransform(D3DTS_VIEW, &mat);
-	D3DXMatrixOrthoOffCenterLH(&mat, 0.0f, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y, 0.0f, -1.0f, +1.0f);
-	g_pd3dDevice->SetTransform(D3DTS_PROJECTION, &mat);
-
-	// Render command lists
-	int vtx_offset = 0;
-	for (int n = 0; n < cmd_lists_count; n++)
-	{
-		// Render command list
-		const ImDrawList* cmd_list = cmd_lists[n];
-		const ImDrawCmd* pcmd_end = cmd_list->commands.end();
-		for (const ImDrawCmd* pcmd = cmd_list->commands.begin(); pcmd != pcmd_end; pcmd++)
-		{
-			const RECT r = { (LONG)pcmd->clip_rect.x, (LONG)pcmd->clip_rect.y, (LONG)pcmd->clip_rect.z, (LONG)pcmd->clip_rect.w };
-			g_pd3dDevice->SetScissorRect(&r);
-			g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, vtx_offset, pcmd->vtx_count/3);
-			vtx_offset += pcmd->vtx_count;
-		}
-	}
+    g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, true );
+    g_pd3dDevice->SetRenderState( D3DRS_BLENDOP, D3DBLENDOP_ADD );
+    g_pd3dDevice->SetRenderState( D3DRS_ALPHATESTENABLE, false );
+    g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
+    g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
+    g_pd3dDevice->SetRenderState( D3DRS_SCISSORTESTENABLE, true );
+
+    // Setup texture
+    g_pd3dDevice->SetTexture( 0, g_pTexture );
+    g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
+    g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
+    g_pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );
+    g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_MODULATE );
+    g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
+    g_pd3dDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE );
+
+    // Setup orthographic projection matrix
+    D3DXMATRIXA16 mat;
+    D3DXMatrixIdentity(&mat);
+    g_pd3dDevice->SetTransform(D3DTS_WORLD, &mat);
+    g_pd3dDevice->SetTransform(D3DTS_VIEW, &mat);
+    D3DXMatrixOrthoOffCenterLH(&mat, 0.0f, ImGui::GetIO().DisplaySize.x, ImGui::GetIO().DisplaySize.y, 0.0f, -1.0f, +1.0f);
+    g_pd3dDevice->SetTransform(D3DTS_PROJECTION, &mat);
+
+    // Render command lists
+    int vtx_offset = 0;
+    for (int n = 0; n < cmd_lists_count; n++)
+    {
+        // Render command list
+        const ImDrawList* cmd_list = cmd_lists[n];
+        const ImDrawCmd* pcmd_end = cmd_list->commands.end();
+        for (const ImDrawCmd* pcmd = cmd_list->commands.begin(); pcmd != pcmd_end; pcmd++)
+        {
+            const RECT r = { (LONG)pcmd->clip_rect.x, (LONG)pcmd->clip_rect.y, (LONG)pcmd->clip_rect.z, (LONG)pcmd->clip_rect.w };
+            g_pd3dDevice->SetScissorRect(&r);
+            g_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLELIST, vtx_offset, pcmd->vtx_count/3);
+            vtx_offset += pcmd->vtx_count;
+        }
+    }
 }
 }
 
 
 HRESULT InitD3D(HWND hWnd)
 HRESULT InitD3D(HWND hWnd)
@@ -111,7 +111,7 @@ HRESULT InitD3D(HWND hWnd)
     d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
     d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
     d3dpp.EnableAutoDepthStencil = TRUE;
     d3dpp.EnableAutoDepthStencil = TRUE;
     d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
     d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
-	d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
+    d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
 
 
     // Create the D3DDevice
     // Create the D3DDevice
     if (g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &g_pd3dDevice) < 0)
     if (g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &g_pd3dDevice) < 0)
@@ -134,90 +134,90 @@ void Cleanup()
 
 
 LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
 {
-	ImGuiIO& io = ImGui::GetIO();
-	switch (msg)
-	{
-	case WM_LBUTTONDOWN:
-		io.MouseDown[0] = true;
-		return true;
-	case WM_LBUTTONUP:
-		io.MouseDown[0] = false; 
-		return true;
-	case WM_RBUTTONDOWN:
-		io.MouseDown[1] = true; 
-		return true;
-	case WM_RBUTTONUP:
-		io.MouseDown[1] = false; 
-		return true;
-	case WM_MOUSEWHEEL:
-		// Mouse wheel: -1,0,+1
-		io.MouseWheel = GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1 : -1;
-		return true;
-	case WM_MOUSEMOVE:
-		// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
-		io.MousePos.x = (signed short)(lParam);
-		io.MousePos.y = (signed short)(lParam >> 16); 
-		return true;
-	case WM_CHAR:
-		// You can also use ToAscii()+GetKeyboardState() to retrieve characters.
-		if (wParam > 1 && wParam < 256)
-			io.AddInputCharacter((char)wParam);
-		return true;
-	case WM_DESTROY:
-		{
-			Cleanup();
-			PostQuitMessage(0);
-			return 0;
-		}
-	}
+    ImGuiIO& io = ImGui::GetIO();
+    switch (msg)
+    {
+    case WM_LBUTTONDOWN:
+        io.MouseDown[0] = true;
+        return true;
+    case WM_LBUTTONUP:
+        io.MouseDown[0] = false; 
+        return true;
+    case WM_RBUTTONDOWN:
+        io.MouseDown[1] = true; 
+        return true;
+    case WM_RBUTTONUP:
+        io.MouseDown[1] = false; 
+        return true;
+    case WM_MOUSEWHEEL:
+        // Mouse wheel: -1,0,+1
+        io.MouseWheel = GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1 : -1;
+        return true;
+    case WM_MOUSEMOVE:
+        // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
+        io.MousePos.x = (signed short)(lParam);
+        io.MousePos.y = (signed short)(lParam >> 16); 
+        return true;
+    case WM_CHAR:
+        // You can also use ToAscii()+GetKeyboardState() to retrieve characters.
+        if (wParam > 1 && wParam < 256)
+            io.AddInputCharacter((char)wParam);
+        return true;
+    case WM_DESTROY:
+        {
+            Cleanup();
+            PostQuitMessage(0);
+            return 0;
+        }
+    }
     return DefWindowProc(hWnd, msg, wParam, lParam);
     return DefWindowProc(hWnd, msg, wParam, lParam);
 }
 }
 
 
 void InitImGui()
 void InitImGui()
 {
 {
-	RECT rect;
-	GetClientRect(hWnd, &rect);
-
-	ImGuiIO& io = ImGui::GetIO();
-	io.DisplaySize = ImVec2((float)(rect.right - rect.left), (float)(rect.bottom - rect.top));	// Display size, in pixels. For clamping windows positions.
-	io.DeltaTime = 1.0f/60.0f;																	// Time elapsed since last frame, in seconds (in this sample app we'll override this every frame because our timestep is variable)
-	io.PixelCenterOffset = 0.0f;																// Align Direct3D Texels
-	io.KeyMap[ImGuiKey_Tab] = VK_TAB;															// Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array that we will update during the application lifetime.
-	io.KeyMap[ImGuiKey_LeftArrow] = VK_LEFT;
-	io.KeyMap[ImGuiKey_RightArrow] = VK_RIGHT;
-	io.KeyMap[ImGuiKey_UpArrow] = VK_UP;
-	io.KeyMap[ImGuiKey_DownArrow] = VK_UP;
-	io.KeyMap[ImGuiKey_Home] = VK_HOME;
-	io.KeyMap[ImGuiKey_End] = VK_END;
-	io.KeyMap[ImGuiKey_Delete] = VK_DELETE;
-	io.KeyMap[ImGuiKey_Backspace] = VK_BACK;
-	io.KeyMap[ImGuiKey_Enter] = VK_RETURN;
-	io.KeyMap[ImGuiKey_Escape] = VK_ESCAPE;
-	io.KeyMap[ImGuiKey_A] = 'A';
-	io.KeyMap[ImGuiKey_C] = 'C';
-	io.KeyMap[ImGuiKey_V] = 'V';
-	io.KeyMap[ImGuiKey_X] = 'X';
-	io.KeyMap[ImGuiKey_Y] = 'Y';
-	io.KeyMap[ImGuiKey_Z] = 'Z';
-
-	io.RenderDrawListsFn = ImImpl_RenderDrawLists;
-	
-	// Create the vertex buffer
-	if (g_pd3dDevice->CreateVertexBuffer(10000 * sizeof(CUSTOMVERTEX), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &g_pVB, NULL) < 0)
-	{
-		IM_ASSERT(0);
-		return;
-	}
-
-	// Load font texture
-	const void* png_data;
-	unsigned int png_size;
-	ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size);
-	if (D3DXCreateTextureFromFileInMemory(g_pd3dDevice, png_data, png_size, &g_pTexture) < 0)
-	{
-		IM_ASSERT(0);
-		return;
-	}
+    RECT rect;
+    GetClientRect(hWnd, &rect);
+
+    ImGuiIO& io = ImGui::GetIO();
+    io.DisplaySize = ImVec2((float)(rect.right - rect.left), (float)(rect.bottom - rect.top));  // Display size, in pixels. For clamping windows positions.
+    io.DeltaTime = 1.0f/60.0f;                                                                  // Time elapsed since last frame, in seconds (in this sample app we'll override this every frame because our timestep is variable)
+    io.PixelCenterOffset = 0.0f;                                                                // Align Direct3D Texels
+    io.KeyMap[ImGuiKey_Tab] = VK_TAB;                                                           // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array that we will update during the application lifetime.
+    io.KeyMap[ImGuiKey_LeftArrow] = VK_LEFT;
+    io.KeyMap[ImGuiKey_RightArrow] = VK_RIGHT;
+    io.KeyMap[ImGuiKey_UpArrow] = VK_UP;
+    io.KeyMap[ImGuiKey_DownArrow] = VK_UP;
+    io.KeyMap[ImGuiKey_Home] = VK_HOME;
+    io.KeyMap[ImGuiKey_End] = VK_END;
+    io.KeyMap[ImGuiKey_Delete] = VK_DELETE;
+    io.KeyMap[ImGuiKey_Backspace] = VK_BACK;
+    io.KeyMap[ImGuiKey_Enter] = VK_RETURN;
+    io.KeyMap[ImGuiKey_Escape] = VK_ESCAPE;
+    io.KeyMap[ImGuiKey_A] = 'A';
+    io.KeyMap[ImGuiKey_C] = 'C';
+    io.KeyMap[ImGuiKey_V] = 'V';
+    io.KeyMap[ImGuiKey_X] = 'X';
+    io.KeyMap[ImGuiKey_Y] = 'Y';
+    io.KeyMap[ImGuiKey_Z] = 'Z';
+
+    io.RenderDrawListsFn = ImImpl_RenderDrawLists;
+    
+    // Create the vertex buffer
+    if (g_pd3dDevice->CreateVertexBuffer(10000 * sizeof(CUSTOMVERTEX), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &g_pVB, NULL) < 0)
+    {
+        IM_ASSERT(0);
+        return;
+    }
+
+    // Load font texture
+    const void* png_data;
+    unsigned int png_size;
+    ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size);
+    if (D3DXCreateTextureFromFileInMemory(g_pd3dDevice, png_data, png_size, &g_pTexture) < 0)
+    {
+        IM_ASSERT(0);
+        return;
+    }
 }
 }
 
 
 INT64 ticks_per_second = 0;
 INT64 ticks_per_second = 0;
@@ -225,28 +225,28 @@ INT64 time = 0;
 
 
 void UpdateImGui()
 void UpdateImGui()
 {
 {
-	ImGuiIO& io = ImGui::GetIO();
-
-	// Setup timestep
-	INT64 current_time;
-	QueryPerformanceCounter((LARGE_INTEGER *)&current_time); 
-	io.DeltaTime = (float)(current_time - time) / ticks_per_second;
-	time = current_time;
-
-	// Setup inputs
-	// (we already got mouse position, buttons, wheel from the window message callback)
-	BYTE keystate[256];
-	GetKeyboardState(keystate);
-	for (int i = 0; i < 256; i++)
-		io.KeysDown[i] = (keystate[i] & 0x80) != 0;
-	io.KeyCtrl = (keystate[VK_CONTROL] & 0x80) != 0;
-	io.KeyShift = (keystate[VK_SHIFT] & 0x80) != 0;
-	// io.MousePos : filled by WM_MOUSEMOVE event
-	// io.MouseDown : filled by WM_*BUTTON* events
-	// io.MouseWheel : filled by WM_MOUSEWHEEL events
-
-	// Start the frame
-	ImGui::NewFrame();
+    ImGuiIO& io = ImGui::GetIO();
+
+    // Setup timestep
+    INT64 current_time;
+    QueryPerformanceCounter((LARGE_INTEGER *)&current_time); 
+    io.DeltaTime = (float)(current_time - time) / ticks_per_second;
+    time = current_time;
+
+    // Setup inputs
+    // (we already got mouse position, buttons, wheel from the window message callback)
+    BYTE keystate[256];
+    GetKeyboardState(keystate);
+    for (int i = 0; i < 256; i++)
+        io.KeysDown[i] = (keystate[i] & 0x80) != 0;
+    io.KeyCtrl = (keystate[VK_CONTROL] & 0x80) != 0;
+    io.KeyShift = (keystate[VK_SHIFT] & 0x80) != 0;
+    // io.MousePos : filled by WM_MOUSEMOVE event
+    // io.MouseDown : filled by WM_*BUTTON* events
+    // io.MouseWheel : filled by WM_MOUSEWHEEL events
+
+    // Start the frame
+    ImGui::NewFrame();
 }
 }
 
 
 int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPWSTR, int)
 int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPWSTR, int)
@@ -258,25 +258,25 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPWSTR, int)
     // Create the application's window
     // Create the application's window
     hWnd = CreateWindow(L"ImGui Example", L"ImGui DirectX9 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL);
     hWnd = CreateWindow(L"ImGui Example", L"ImGui DirectX9 Example", WS_OVERLAPPEDWINDOW, 100, 100, 1280, 800, NULL, NULL, wc.hInstance, NULL);
 
 
-	if (!QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second))
-		return 1;
-	if (!QueryPerformanceCounter((LARGE_INTEGER *)&time))
-		return 1;
+    if (!QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second))
+        return 1;
+    if (!QueryPerformanceCounter((LARGE_INTEGER *)&time))
+        return 1;
 
 
-	// Initialize Direct3D
+    // Initialize Direct3D
     if (InitD3D(hWnd) < 0)
     if (InitD3D(hWnd) < 0)
-	{
-		if (g_pVB)
-			g_pVB->Release();
-	    UnregisterClass(L"ImGui Example", wc.hInstance);
-		return 1;
-	}
+    {
+        if (g_pVB)
+            g_pVB->Release();
+        UnregisterClass(L"ImGui Example", wc.hInstance);
+        return 1;
+    }
 
 
-	// Show the window
-	ShowWindow(hWnd, SW_SHOWDEFAULT);
-	UpdateWindow(hWnd);
+    // Show the window
+    ShowWindow(hWnd, SW_SHOWDEFAULT);
+    UpdateWindow(hWnd);
 
 
-	InitImGui();
+    InitImGui();
 
 
     // Enter the message loop
     // Enter the message loop
     MSG msg;
     MSG msg;
@@ -287,65 +287,65 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPWSTR, int)
         {
         {
             TranslateMessage(&msg);
             TranslateMessage(&msg);
             DispatchMessage(&msg);
             DispatchMessage(&msg);
-			continue;
+            continue;
         }
         }
-		
-		UpdateImGui();
-
-		// Create a simple window
-		// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
-		static bool show_test_window = true;
-		static bool show_another_window = false;
-		static float f;
-		ImGui::Text("Hello, world!");
-		ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
-		show_test_window ^= ImGui::Button("Test Window");
-		show_another_window ^= ImGui::Button("Another Window");
-
-		// Calculate and show framerate
-		static float ms_per_frame[120] = { 0 };
-		static int ms_per_frame_idx = 0;
-		static float ms_per_frame_accum = 0.0f;
-		ms_per_frame_accum -= ms_per_frame[ms_per_frame_idx];
-		ms_per_frame[ms_per_frame_idx] = ImGui::GetIO().DeltaTime * 1000.0f;
-		ms_per_frame_accum += ms_per_frame[ms_per_frame_idx];
-		ms_per_frame_idx = (ms_per_frame_idx + 1) % 120;
-		const float ms_per_frame_avg = ms_per_frame_accum / 120;
-		ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", ms_per_frame_avg, 1000.0f / ms_per_frame_avg);
-
-		// Show the ImGui test window
-		// Most of user example code is in ImGui::ShowTestWindow()
-		if (show_test_window)
-		{
-			ImGui::SetNewWindowDefaultPos(ImVec2(650, 20));		// Normally user code doesn't need/want to call it because positions are saved in .ini file anyway. Here we just want to make the demo initial state a bit more friendly!
-			ImGui::ShowTestWindow(&show_test_window);
-		}
-
-		// Show another simple window
-		if (show_another_window)
-		{
-			ImGui::Begin("Another Window", &show_another_window, ImVec2(200,100));
-			ImGui::Text("Hello");
-			ImGui::End();
-		}
-
-		// Rendering
-		g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, false);
-		g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
-		g_pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, false);
-		g_pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(204, 153, 153), 1.0f, 0);
-		if (g_pd3dDevice->BeginScene() >= 0)
-		{
-			ImGui::Render();
-			g_pd3dDevice->EndScene();
-		}
-		g_pd3dDevice->Present(NULL, NULL, NULL, NULL);
-	}
-
-	ImGui::Shutdown();
-
-	if (g_pVB)
-		g_pVB->Release();
+        
+        UpdateImGui();
+
+        // Create a simple window
+        // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
+        static bool show_test_window = true;
+        static bool show_another_window = false;
+        static float f;
+        ImGui::Text("Hello, world!");
+        ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
+        show_test_window ^= ImGui::Button("Test Window");
+        show_another_window ^= ImGui::Button("Another Window");
+
+        // Calculate and show framerate
+        static float ms_per_frame[120] = { 0 };
+        static int ms_per_frame_idx = 0;
+        static float ms_per_frame_accum = 0.0f;
+        ms_per_frame_accum -= ms_per_frame[ms_per_frame_idx];
+        ms_per_frame[ms_per_frame_idx] = ImGui::GetIO().DeltaTime * 1000.0f;
+        ms_per_frame_accum += ms_per_frame[ms_per_frame_idx];
+        ms_per_frame_idx = (ms_per_frame_idx + 1) % 120;
+        const float ms_per_frame_avg = ms_per_frame_accum / 120;
+        ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", ms_per_frame_avg, 1000.0f / ms_per_frame_avg);
+
+        // Show the ImGui test window
+        // Most of user example code is in ImGui::ShowTestWindow()
+        if (show_test_window)
+        {
+            ImGui::SetNewWindowDefaultPos(ImVec2(650, 20));     // Normally user code doesn't need/want to call it because positions are saved in .ini file anyway. Here we just want to make the demo initial state a bit more friendly!
+            ImGui::ShowTestWindow(&show_test_window);
+        }
+
+        // Show another simple window
+        if (show_another_window)
+        {
+            ImGui::Begin("Another Window", &show_another_window, ImVec2(200,100));
+            ImGui::Text("Hello");
+            ImGui::End();
+        }
+
+        // Rendering
+        g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, false);
+        g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
+        g_pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, false);
+        g_pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(204, 153, 153), 1.0f, 0);
+        if (g_pd3dDevice->BeginScene() >= 0)
+        {
+            ImGui::Render();
+            g_pd3dDevice->EndScene();
+        }
+        g_pd3dDevice->Present(NULL, NULL, NULL, NULL);
+    }
+
+    ImGui::Shutdown();
+
+    if (g_pVB)
+        g_pVB->Release();
 
 
     UnregisterClass(L"ImGui Example", wc.hInstance);
     UnregisterClass(L"ImGui Example", wc.hInstance);
     return 0;
     return 0;

+ 204 - 204
examples/opengl_example/main.cpp

@@ -2,10 +2,10 @@
 #include <GL/glew.h>
 #include <GL/glew.h>
 #include <GLFW/glfw3.h>
 #include <GLFW/glfw3.h>
 #define STB_IMAGE_IMPLEMENTATION
 #define STB_IMAGE_IMPLEMENTATION
-#include "stb_image.h"					// for .png loading
+#include "stb_image.h"                  // for .png loading
 #include "../../imgui.h"
 #include "../../imgui.h"
 #ifdef _MSC_VER
 #ifdef _MSC_VER
-#pragma warning (disable: 4996)			// 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
+#pragma warning (disable: 4996)         // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
 #endif
 #endif
 
 
 static GLFWwindow* window;
 static GLFWwindow* window;
@@ -16,253 +16,253 @@ static GLuint fontTex;
 // A faster way would be to collate all vertices from all cmd_lists into a single vertex buffer
 // A faster way would be to collate all vertices from all cmd_lists into a single vertex buffer
 static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count)
 static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count)
 {
 {
-	if (cmd_lists_count == 0)
-		return;
-
-	// Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, vertex/texcoord/color pointers.
-	glEnable(GL_BLEND);
-	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-	glDisable(GL_CULL_FACE);
-	glDisable(GL_DEPTH_TEST);
-	glEnable(GL_SCISSOR_TEST);
-	glEnableClientState(GL_VERTEX_ARRAY);
-	glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-	glEnableClientState(GL_COLOR_ARRAY);
-
-	// Setup texture
-	glBindTexture(GL_TEXTURE_2D, fontTex);
-	glEnable(GL_TEXTURE_2D);
-
-	// Setup orthographic projection matrix
-	const float width = ImGui::GetIO().DisplaySize.x;
-	const float height = ImGui::GetIO().DisplaySize.y;
-	glMatrixMode(GL_PROJECTION);
-	glLoadIdentity();
-	glOrtho(0.0f, width, height, 0.0f, -1.0f, +1.0f);
-	glMatrixMode(GL_MODELVIEW);
-	glLoadIdentity();
-
-	// Render command lists
-	for (int n = 0; n < cmd_lists_count; n++)
-	{
-		const ImDrawList* cmd_list = cmd_lists[n];
-		const unsigned char* vtx_buffer = (const unsigned char*)cmd_list->vtx_buffer.begin();
-		glVertexPointer(2, GL_FLOAT, sizeof(ImDrawVert), (void*)(vtx_buffer));
-		glTexCoordPointer(2, GL_FLOAT, sizeof(ImDrawVert), (void*)(vtx_buffer+8));
-		glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(ImDrawVert), (void*)(vtx_buffer+16));
-
-		int vtx_offset = 0;
-		const ImDrawCmd* pcmd_end = cmd_list->commands.end();
-		for (const ImDrawCmd* pcmd = cmd_list->commands.begin(); pcmd != pcmd_end; pcmd++)
-		{
-			glScissor((int)pcmd->clip_rect.x, (int)(height - pcmd->clip_rect.w), (int)(pcmd->clip_rect.z - pcmd->clip_rect.x), (int)(pcmd->clip_rect.w - pcmd->clip_rect.y));
-			glDrawArrays(GL_TRIANGLES, vtx_offset, pcmd->vtx_count);
-			vtx_offset += pcmd->vtx_count;
-		}
-	}
-	glDisable(GL_SCISSOR_TEST);
+    if (cmd_lists_count == 0)
+        return;
+
+    // Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, vertex/texcoord/color pointers.
+    glEnable(GL_BLEND);
+    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+    glDisable(GL_CULL_FACE);
+    glDisable(GL_DEPTH_TEST);
+    glEnable(GL_SCISSOR_TEST);
+    glEnableClientState(GL_VERTEX_ARRAY);
+    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+    glEnableClientState(GL_COLOR_ARRAY);
+
+    // Setup texture
+    glBindTexture(GL_TEXTURE_2D, fontTex);
+    glEnable(GL_TEXTURE_2D);
+
+    // Setup orthographic projection matrix
+    const float width = ImGui::GetIO().DisplaySize.x;
+    const float height = ImGui::GetIO().DisplaySize.y;
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    glOrtho(0.0f, width, height, 0.0f, -1.0f, +1.0f);
+    glMatrixMode(GL_MODELVIEW);
+    glLoadIdentity();
+
+    // Render command lists
+    for (int n = 0; n < cmd_lists_count; n++)
+    {
+        const ImDrawList* cmd_list = cmd_lists[n];
+        const unsigned char* vtx_buffer = (const unsigned char*)cmd_list->vtx_buffer.begin();
+        glVertexPointer(2, GL_FLOAT, sizeof(ImDrawVert), (void*)(vtx_buffer));
+        glTexCoordPointer(2, GL_FLOAT, sizeof(ImDrawVert), (void*)(vtx_buffer+8));
+        glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(ImDrawVert), (void*)(vtx_buffer+16));
+
+        int vtx_offset = 0;
+        const ImDrawCmd* pcmd_end = cmd_list->commands.end();
+        for (const ImDrawCmd* pcmd = cmd_list->commands.begin(); pcmd != pcmd_end; pcmd++)
+        {
+            glScissor((int)pcmd->clip_rect.x, (int)(height - pcmd->clip_rect.w), (int)(pcmd->clip_rect.z - pcmd->clip_rect.x), (int)(pcmd->clip_rect.w - pcmd->clip_rect.y));
+            glDrawArrays(GL_TRIANGLES, vtx_offset, pcmd->vtx_count);
+            vtx_offset += pcmd->vtx_count;
+        }
+    }
+    glDisable(GL_SCISSOR_TEST);
 }
 }
 
 
 static const char* ImImpl_GetClipboardTextFn()
 static const char* ImImpl_GetClipboardTextFn()
 {
 {
-	return glfwGetClipboardString(window);
+    return glfwGetClipboardString(window);
 }
 }
 
 
 static void ImImpl_SetClipboardTextFn(const char* text, const char* text_end)
 static void ImImpl_SetClipboardTextFn(const char* text, const char* text_end)
 {
 {
-	if (!text_end)
-		text_end = text + strlen(text);
-
-	if (*text_end == 0)
-	{
-		// Already got a zero-terminator at 'text_end', we don't need to add one
-		glfwSetClipboardString(window, text);
-	}
-	else
-	{
-		// Add a zero-terminator because glfw function doesn't take a size
-		char* buf = (char*)malloc(text_end - text + 1);
-		memcpy(buf, text, text_end-text);
-		buf[text_end-text] = '\0';
-		glfwSetClipboardString(window, buf);
-		free(buf);
-	}
+    if (!text_end)
+        text_end = text + strlen(text);
+
+    if (*text_end == 0)
+    {
+        // Already got a zero-terminator at 'text_end', we don't need to add one
+        glfwSetClipboardString(window, text);
+    }
+    else
+    {
+        // Add a zero-terminator because glfw function doesn't take a size
+        char* buf = (char*)malloc(text_end - text + 1);
+        memcpy(buf, text, text_end-text);
+        buf[text_end-text] = '\0';
+        glfwSetClipboardString(window, buf);
+        free(buf);
+    }
 }
 }
 
 
 
 
 // GLFW callbacks to get events
 // GLFW callbacks to get events
 static void glfw_error_callback(int error, const char* description)
 static void glfw_error_callback(int error, const char* description)
 {
 {
-	fputs(description, stderr);
+    fputs(description, stderr);
 }
 }
 
 
 static void glfw_scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
 static void glfw_scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
 {
 {
-	ImGuiIO& io = ImGui::GetIO();
-	io.MouseWheel = (yoffset != 0.0f) ? yoffset > 0.0f ? 1 : - 1 : 0;			// Mouse wheel: -1,0,+1
+    ImGuiIO& io = ImGui::GetIO();
+    io.MouseWheel = (yoffset != 0.0f) ? yoffset > 0.0f ? 1 : - 1 : 0;           // Mouse wheel: -1,0,+1
 }
 }
 
 
 static void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
 static void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
 {
 {
-	ImGuiIO& io = ImGui::GetIO();
-	if (action == GLFW_PRESS)
-		io.KeysDown[key] = true;
-	if (action == GLFW_RELEASE)
-		io.KeysDown[key] = false;
-	io.KeyCtrl = (mods & GLFW_MOD_CONTROL) != 0;
-	io.KeyShift = (mods & GLFW_MOD_SHIFT) != 0;
+    ImGuiIO& io = ImGui::GetIO();
+    if (action == GLFW_PRESS)
+        io.KeysDown[key] = true;
+    if (action == GLFW_RELEASE)
+        io.KeysDown[key] = false;
+    io.KeyCtrl = (mods & GLFW_MOD_CONTROL) != 0;
+    io.KeyShift = (mods & GLFW_MOD_SHIFT) != 0;
 }
 }
 
 
 static void glfw_char_callback(GLFWwindow* window, unsigned int c)
 static void glfw_char_callback(GLFWwindow* window, unsigned int c)
 {
 {
-	if (c > 0 && c <= 255)
-		ImGui::GetIO().AddInputCharacter((char)c);
+    if (c > 0 && c <= 255)
+        ImGui::GetIO().AddInputCharacter((char)c);
 }
 }
 
 
 // OpenGL code based on http://open.gl tutorials
 // OpenGL code based on http://open.gl tutorials
 void InitGL()
 void InitGL()
 {
 {
-	glfwSetErrorCallback(glfw_error_callback);
+    glfwSetErrorCallback(glfw_error_callback);
 
 
-	if (!glfwInit())
-		exit(1);
+    if (!glfwInit())
+        exit(1);
 
 
-	glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
-	window = glfwCreateWindow(1280, 720, "ImGui OpenGL example", NULL, NULL);
-	glfwMakeContextCurrent(window);
-	glfwSetKeyCallback(window, glfw_key_callback);
-	glfwSetScrollCallback(window, glfw_scroll_callback);
-	glfwSetCharCallback(window, glfw_char_callback);
+    glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
+    window = glfwCreateWindow(1280, 720, "ImGui OpenGL example", NULL, NULL);
+    glfwMakeContextCurrent(window);
+    glfwSetKeyCallback(window, glfw_key_callback);
+    glfwSetScrollCallback(window, glfw_scroll_callback);
+    glfwSetCharCallback(window, glfw_char_callback);
 
 
-	glewInit();
+    glewInit();
 }
 }
 
 
 void InitImGui()
 void InitImGui()
 {
 {
-	int w, h;
-	glfwGetWindowSize(window, &w, &h);
-
-	ImGuiIO& io = ImGui::GetIO();
-	io.DisplaySize = ImVec2((float)w, (float)h);            // Display size, in pixels. For clamping windows positions.
-	io.DeltaTime = 1.0f/60.0f;                                // Time elapsed since last frame, in seconds (in this sample app we'll override this every frame because our timestep is variable)
-	io.PixelCenterOffset = 0.5f;                            // Align OpenGL texels
-	io.KeyMap[ImGuiKey_Tab] = GLFW_KEY_TAB;                    // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array.
-	io.KeyMap[ImGuiKey_LeftArrow] = GLFW_KEY_LEFT;
-	io.KeyMap[ImGuiKey_RightArrow] = GLFW_KEY_RIGHT;
-	io.KeyMap[ImGuiKey_UpArrow] = GLFW_KEY_UP;
-	io.KeyMap[ImGuiKey_DownArrow] = GLFW_KEY_DOWN;
-	io.KeyMap[ImGuiKey_Home] = GLFW_KEY_HOME;
-	io.KeyMap[ImGuiKey_End] = GLFW_KEY_END;
-	io.KeyMap[ImGuiKey_Delete] = GLFW_KEY_DELETE;
-	io.KeyMap[ImGuiKey_Backspace] = GLFW_KEY_BACKSPACE;
-	io.KeyMap[ImGuiKey_Enter] = GLFW_KEY_ENTER;
-	io.KeyMap[ImGuiKey_Escape] = GLFW_KEY_ESCAPE;
-	io.KeyMap[ImGuiKey_A] = GLFW_KEY_A;
-	io.KeyMap[ImGuiKey_C] = GLFW_KEY_C;
-	io.KeyMap[ImGuiKey_V] = GLFW_KEY_V;
-	io.KeyMap[ImGuiKey_X] = GLFW_KEY_X;
-	io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
-	io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
-
-	io.RenderDrawListsFn = ImImpl_RenderDrawLists;
-	io.SetClipboardTextFn = ImImpl_SetClipboardTextFn;
-	io.GetClipboardTextFn = ImImpl_GetClipboardTextFn;
-
-	// Load font texture
-	glGenTextures(1, &fontTex);
-	glBindTexture(GL_TEXTURE_2D, fontTex);
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
-	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-	const void* png_data;
-	unsigned int png_size;
-	ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size);
-	int tex_x, tex_y, tex_comp;
-	void* tex_data = stbi_load_from_memory((const unsigned char*)png_data, (int)png_size, &tex_x, &tex_y, &tex_comp, 0);
-	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_x, tex_y, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex_data);
-	stbi_image_free(tex_data);
+    int w, h;
+    glfwGetWindowSize(window, &w, &h);
+
+    ImGuiIO& io = ImGui::GetIO();
+    io.DisplaySize = ImVec2((float)w, (float)h);            // Display size, in pixels. For clamping windows positions.
+    io.DeltaTime = 1.0f/60.0f;                                // Time elapsed since last frame, in seconds (in this sample app we'll override this every frame because our timestep is variable)
+    io.PixelCenterOffset = 0.5f;                            // Align OpenGL texels
+    io.KeyMap[ImGuiKey_Tab] = GLFW_KEY_TAB;                    // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array.
+    io.KeyMap[ImGuiKey_LeftArrow] = GLFW_KEY_LEFT;
+    io.KeyMap[ImGuiKey_RightArrow] = GLFW_KEY_RIGHT;
+    io.KeyMap[ImGuiKey_UpArrow] = GLFW_KEY_UP;
+    io.KeyMap[ImGuiKey_DownArrow] = GLFW_KEY_DOWN;
+    io.KeyMap[ImGuiKey_Home] = GLFW_KEY_HOME;
+    io.KeyMap[ImGuiKey_End] = GLFW_KEY_END;
+    io.KeyMap[ImGuiKey_Delete] = GLFW_KEY_DELETE;
+    io.KeyMap[ImGuiKey_Backspace] = GLFW_KEY_BACKSPACE;
+    io.KeyMap[ImGuiKey_Enter] = GLFW_KEY_ENTER;
+    io.KeyMap[ImGuiKey_Escape] = GLFW_KEY_ESCAPE;
+    io.KeyMap[ImGuiKey_A] = GLFW_KEY_A;
+    io.KeyMap[ImGuiKey_C] = GLFW_KEY_C;
+    io.KeyMap[ImGuiKey_V] = GLFW_KEY_V;
+    io.KeyMap[ImGuiKey_X] = GLFW_KEY_X;
+    io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
+    io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
+
+    io.RenderDrawListsFn = ImImpl_RenderDrawLists;
+    io.SetClipboardTextFn = ImImpl_SetClipboardTextFn;
+    io.GetClipboardTextFn = ImImpl_GetClipboardTextFn;
+
+    // Load font texture
+    glGenTextures(1, &fontTex);
+    glBindTexture(GL_TEXTURE_2D, fontTex);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+    const void* png_data;
+    unsigned int png_size;
+    ImGui::GetDefaultFontData(NULL, NULL, &png_data, &png_size);
+    int tex_x, tex_y, tex_comp;
+    void* tex_data = stbi_load_from_memory((const unsigned char*)png_data, (int)png_size, &tex_x, &tex_y, &tex_comp, 0);
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex_x, tex_y, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex_data);
+    stbi_image_free(tex_data);
 }
 }
 
 
 void UpdateImGui()
 void UpdateImGui()
 {
 {
-	ImGuiIO& io = ImGui::GetIO();
-
-	// Setup timestep
-	static double time = 0.0f;
-	const double current_time =  glfwGetTime();
-	io.DeltaTime = (float)(current_time - time);
-	time = current_time;
-
-	// Setup inputs
-	// (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
-	double mouse_x, mouse_y;
-	glfwGetCursorPos(window, &mouse_x, &mouse_y);
-	io.MousePos = ImVec2((float)mouse_x, (float)mouse_y);                           // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
-	io.MouseDown[0] = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) != 0;
-	io.MouseDown[1] = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_RIGHT) != 0;
-
-	// Start the frame
-	ImGui::NewFrame();
+    ImGuiIO& io = ImGui::GetIO();
+
+    // Setup timestep
+    static double time = 0.0f;
+    const double current_time =  glfwGetTime();
+    io.DeltaTime = (float)(current_time - time);
+    time = current_time;
+
+    // Setup inputs
+    // (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
+    double mouse_x, mouse_y;
+    glfwGetCursorPos(window, &mouse_x, &mouse_y);
+    io.MousePos = ImVec2((float)mouse_x, (float)mouse_y);                           // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
+    io.MouseDown[0] = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) != 0;
+    io.MouseDown[1] = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_RIGHT) != 0;
+
+    // Start the frame
+    ImGui::NewFrame();
 }
 }
 
 
 // Application code
 // Application code
 int main(int argc, char** argv)
 int main(int argc, char** argv)
 {
 {
-	InitGL();
-	InitImGui();
-
-	while (!glfwWindowShouldClose(window))
-	{
-		ImGuiIO& io = ImGui::GetIO();
-		io.MouseWheel = 0;
-		glfwPollEvents();
-		UpdateImGui();
-
-		// Create a simple window
-		// Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
-		static bool show_test_window = true;
-		static bool show_another_window = false;
-		static float f;
-		ImGui::Text("Hello, world!");
-		ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
-		show_test_window ^= ImGui::Button("Test Window");
-		show_another_window ^= ImGui::Button("Another Window");
-
-		// Calculate and show framerate
-		static float ms_per_frame[120] = { 0 };
-		static int ms_per_frame_idx = 0;
-		static float ms_per_frame_accum = 0.0f;
-		ms_per_frame_accum -= ms_per_frame[ms_per_frame_idx];
-		ms_per_frame[ms_per_frame_idx] = ImGui::GetIO().DeltaTime * 1000.0f;
-		ms_per_frame_accum += ms_per_frame[ms_per_frame_idx];
-		ms_per_frame_idx = (ms_per_frame_idx + 1) % 120;
-		const float ms_per_frame_avg = ms_per_frame_accum / 120;
-		ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", ms_per_frame_avg, 1000.0f / ms_per_frame_avg);
-
-		// Show the ImGui test window
-		// Most of user example code is in ImGui::ShowTestWindow()
-		if (show_test_window)
-		{
-			ImGui::SetNewWindowDefaultPos(ImVec2(650, 20));        // Normally user code doesn't need/want to call it because positions are saved in .ini file anyway. Here we just want to make the demo initial state a bit more friendly!
-			ImGui::ShowTestWindow(&show_test_window);
-		}
-
-		// Show another simple window
-		if (show_another_window)
-		{
-			ImGui::Begin("Another Window", &show_another_window, ImVec2(200,100));
-			ImGui::Text("Hello");
-			ImGui::End();
-		}
-
-		// Rendering
-		glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
-		glClearColor(0.8f, 0.6f, 0.6f, 1.0f);
-		glClear(GL_COLOR_BUFFER_BIT);
-		ImGui::Render();
-		glfwSwapBuffers(window);
-	}
-
-	ImGui::Shutdown();
-	glfwTerminate();
-	return 0;
+    InitGL();
+    InitImGui();
+
+    while (!glfwWindowShouldClose(window))
+    {
+        ImGuiIO& io = ImGui::GetIO();
+        io.MouseWheel = 0;
+        glfwPollEvents();
+        UpdateImGui();
+
+        // Create a simple window
+        // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called "Debug"
+        static bool show_test_window = true;
+        static bool show_another_window = false;
+        static float f;
+        ImGui::Text("Hello, world!");
+        ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
+        show_test_window ^= ImGui::Button("Test Window");
+        show_another_window ^= ImGui::Button("Another Window");
+
+        // Calculate and show framerate
+        static float ms_per_frame[120] = { 0 };
+        static int ms_per_frame_idx = 0;
+        static float ms_per_frame_accum = 0.0f;
+        ms_per_frame_accum -= ms_per_frame[ms_per_frame_idx];
+        ms_per_frame[ms_per_frame_idx] = ImGui::GetIO().DeltaTime * 1000.0f;
+        ms_per_frame_accum += ms_per_frame[ms_per_frame_idx];
+        ms_per_frame_idx = (ms_per_frame_idx + 1) % 120;
+        const float ms_per_frame_avg = ms_per_frame_accum / 120;
+        ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", ms_per_frame_avg, 1000.0f / ms_per_frame_avg);
+
+        // Show the ImGui test window
+        // Most of user example code is in ImGui::ShowTestWindow()
+        if (show_test_window)
+        {
+            ImGui::SetNewWindowDefaultPos(ImVec2(650, 20));        // Normally user code doesn't need/want to call it because positions are saved in .ini file anyway. Here we just want to make the demo initial state a bit more friendly!
+            ImGui::ShowTestWindow(&show_test_window);
+        }
+
+        // Show another simple window
+        if (show_another_window)
+        {
+            ImGui::Begin("Another Window", &show_another_window, ImVec2(200,100));
+            ImGui::Text("Hello");
+            ImGui::End();
+        }
+
+        // Rendering
+        glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
+        glClearColor(0.8f, 0.6f, 0.6f, 1.0f);
+        glClear(GL_COLOR_BUFFER_BIT);
+        ImGui::Render();
+        glfwSwapBuffers(window);
+    }
+
+    ImGui::Shutdown();
+    glfwTerminate();
+    return 0;
 }
 }

+ 12 - 12
imconfig.h

@@ -6,28 +6,28 @@
 
 
 //---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h
 //---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h
 //#include <vector>
 //#include <vector>
-//#define ImVector	std::vector
-//#define ImVector	MyVector
+//#define ImVector  std::vector
+//#define ImVector  MyVector
 
 
 //---- Define assertion handler. Defaults to calling assert().
 //---- Define assertion handler. Defaults to calling assert().
-//#define IM_ASSERT(_EXPR)	MyAssert(_EXPR)
+//#define IM_ASSERT(_EXPR)  MyAssert(_EXPR)
 
 
 //---- Don't implement default clipboard handlers for Windows (so as not to link with OpenClipboard(), etc.)
 //---- Don't implement default clipboard handlers for Windows (so as not to link with OpenClipboard(), etc.)
 //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
 //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCS
 
 
 //---- If you are loading a custom font, ImGui expect to find a pure white pixel at (0,0)
 //---- If you are loading a custom font, ImGui expect to find a pure white pixel at (0,0)
 // Change it's UV coordinate here if you can't have a white pixel at (0,0)
 // Change it's UV coordinate here if you can't have a white pixel at (0,0)
-//#define IMGUI_FONT_TEX_UV_FOR_WHITE	ImVec2(0.f/256.f,0.f/256.f)
+//#define IMGUI_FONT_TEX_UV_FOR_WHITE   ImVec2(0.f/256.f,0.f/256.f)
 
 
 //---- Define implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
 //---- Define implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4.
 /*
 /*
-#define IM_VEC2_CLASS_EXTRA													\
-		ImVec2(const MyVec2& f) { x = f.x; y = f.y; }						\
-		operator MyVec2() const { return MyVec2(x,y); }
+#define IM_VEC2_CLASS_EXTRA                                                 \
+        ImVec2(const MyVec2& f) { x = f.x; y = f.y; }                       \
+        operator MyVec2() const { return MyVec2(x,y); }
 
 
-#define IM_VEC4_CLASS_EXTRA													\
-		ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; }		\
-		operator MyVec4() const { return MyVec4(x,y,z,w); }
+#define IM_VEC4_CLASS_EXTRA                                                 \
+        ImVec4(const MyVec4& f) { x = f.x; y = f.y; z = f.z; w = f.w; }     \
+        operator MyVec4() const { return MyVec4(x,y,z,w); }
 */
 */
 
 
 //---- Freely implement extra functions within the ImGui:: namespace.
 //---- Freely implement extra functions within the ImGui:: namespace.
@@ -35,7 +35,7 @@
 /*
 /*
 namespace ImGui
 namespace ImGui
 {
 {
-	void	Value(const char* prefix, const MyVec2& v, const char* float_format = NULL);
-	void	Value(const char* prefix, const MyVec4& v, const char* float_format = NULL);
+    void    Value(const char* prefix, const MyVec2& v, const char* float_format = NULL);
+    void    Value(const char* prefix, const MyVec4& v, const char* float_format = NULL);
 };
 };
 */
 */

File diff suppressed because it is too large
+ 640 - 640
imgui.cpp


+ 485 - 485
imgui.h

@@ -15,43 +15,43 @@ struct ImGuiStyle;
 struct ImGuiWindow;
 struct ImGuiWindow;
 
 
 #include "imconfig.h"
 #include "imconfig.h"
-#include <float.h>			// FLT_MAX
-#include <stdarg.h>			// va_list
-#include <stdlib.h>			// NULL
+#include <float.h>          // FLT_MAX
+#include <stdarg.h>         // va_list
+#include <stdlib.h>         // NULL
 
 
 #ifndef IM_ASSERT
 #ifndef IM_ASSERT
 #include <assert.h>
 #include <assert.h>
-#define IM_ASSERT(_EXPR)	assert(_EXPR)
+#define IM_ASSERT(_EXPR)    assert(_EXPR)
 #endif
 #endif
 
 
 typedef unsigned int ImU32;
 typedef unsigned int ImU32;
 typedef ImU32 ImGuiID;
 typedef ImU32 ImGuiID;
-typedef int ImGuiCol;				// enum ImGuiCol_
-typedef int ImGuiKey;				// enum ImGuiKey_
-typedef int ImGuiColorEditMode;		// enum ImGuiColorEditMode_
-typedef int ImGuiWindowFlags;		// enum ImGuiWindowFlags_
-typedef int ImGuiInputTextFlags;	// enum ImGuiInputTextFlags_
+typedef int ImGuiCol;               // enum ImGuiCol_
+typedef int ImGuiKey;               // enum ImGuiKey_
+typedef int ImGuiColorEditMode;     // enum ImGuiColorEditMode_
+typedef int ImGuiWindowFlags;       // enum ImGuiWindowFlags_
+typedef int ImGuiInputTextFlags;    // enum ImGuiInputTextFlags_
 typedef ImBitmapFont* ImFont;
 typedef ImBitmapFont* ImFont;
 
 
 struct ImVec2
 struct ImVec2
 {
 {
-	float x, y;
-	ImVec2() {}
-	ImVec2(float _x, float _y) { x = _x; y = _y; }
+    float x, y;
+    ImVec2() {}
+    ImVec2(float _x, float _y) { x = _x; y = _y; }
 
 
 #ifdef IM_VEC2_CLASS_EXTRA
 #ifdef IM_VEC2_CLASS_EXTRA
-	IM_VEC2_CLASS_EXTRA
+    IM_VEC2_CLASS_EXTRA
 #endif
 #endif
 };
 };
 
 
 struct ImVec4
 struct ImVec4
 {
 {
-	float x, y, z, w;
-	ImVec4() {}
-	ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
+    float x, y, z, w;
+    ImVec4() {}
+    ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
 
 
 #ifdef IM_VEC4_CLASS_EXTRA
 #ifdef IM_VEC4_CLASS_EXTRA
-	IM_VEC4_CLASS_EXTRA
+    IM_VEC4_CLASS_EXTRA
 #endif
 #endif
 };
 };
 
 
@@ -62,373 +62,373 @@ template<typename T>
 class ImVector
 class ImVector
 {
 {
 private:
 private:
-	size_t						Size;
-	size_t						Capacity;
-	T*							Data;
+    size_t                      Size;
+    size_t                      Capacity;
+    T*                          Data;
 
 
 public:
 public:
-	typedef T					value_type;
-	typedef value_type*			iterator;
-	typedef const value_type*	const_iterator;
-
-	ImVector()					{ Size = Capacity = 0; Data = NULL; }
-	~ImVector()					{ if (Data) free(Data); }
-
-	inline bool					empty() const					{ return Size == 0; }
-	inline size_t				size() const					{ return Size; }
-	inline size_t				capacity() const				{ return Capacity; }
-
-    inline value_type&			at(size_t i)					{ IM_ASSERT(i < Size); return Data[i]; }
-    inline const value_type&	at(size_t i) const				{ IM_ASSERT(i < Size); return Data[i]; }
-    inline value_type&			operator[](size_t i)			{ IM_ASSERT(i < Size); return Data[i]; }
-    inline const value_type&	operator[](size_t i) const		{ IM_ASSERT(i < Size); return Data[i]; }
-
-	inline void					clear()							{ if (Data) { Size = Capacity = 0; free(Data); Data = NULL; } }
-	inline iterator				begin()							{ return Data; }
-	inline const_iterator		begin() const					{ return Data; }
-	inline iterator				end()							{ return Data + Size; }
-	inline const_iterator		end() const						{ return Data + Size; }
-	inline value_type&			front()							{ return at(0); }
-	inline const value_type&	front() const					{ return at(0); }
-	inline value_type&			back()							{ IM_ASSERT(Size > 0); return at(Size-1); }
-	inline const value_type&	back() const					{ IM_ASSERT(Size > 0); return at(Size-1); }
-	inline void					swap(ImVector<T>& rhs)			{ const size_t rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; const size_t rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
-
-	inline void					reserve(size_t new_capacity)	{ Data = (value_type*)realloc(Data, new_capacity * sizeof(value_type)); Capacity = new_capacity; }
-	inline void					resize(size_t new_size)			{ if (new_size > Capacity) reserve(new_size); Size = new_size; }
-
-	inline void					push_back(const value_type& v)	{ if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; }
-	inline void					pop_back()						{ IM_ASSERT(Size > 0); Size--; }
-
-	inline iterator				erase(const_iterator it)		{ IM_ASSERT(it >= begin() && it < end()); const int off = it - begin(); memmove(Data + off, Data + off + 1, (Size - off - 1) * sizeof(value_type)); Size--; return Data + off; }
-	inline void					insert(const_iterator it, const value_type& v)	{ IM_ASSERT(it >= begin() && it <= end()); const int off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, (Size - off) * sizeof(value_type)); Data[off] = v; Size++; }
+    typedef T                   value_type;
+    typedef value_type*         iterator;
+    typedef const value_type*   const_iterator;
+
+    ImVector()                  { Size = Capacity = 0; Data = NULL; }
+    ~ImVector()                 { if (Data) free(Data); }
+
+    inline bool                 empty() const                   { return Size == 0; }
+    inline size_t               size() const                    { return Size; }
+    inline size_t               capacity() const                { return Capacity; }
+
+    inline value_type&          at(size_t i)                    { IM_ASSERT(i < Size); return Data[i]; }
+    inline const value_type&    at(size_t i) const              { IM_ASSERT(i < Size); return Data[i]; }
+    inline value_type&          operator[](size_t i)            { IM_ASSERT(i < Size); return Data[i]; }
+    inline const value_type&    operator[](size_t i) const      { IM_ASSERT(i < Size); return Data[i]; }
+
+    inline void                 clear()                         { if (Data) { Size = Capacity = 0; free(Data); Data = NULL; } }
+    inline iterator             begin()                         { return Data; }
+    inline const_iterator       begin() const                   { return Data; }
+    inline iterator             end()                           { return Data + Size; }
+    inline const_iterator       end() const                     { return Data + Size; }
+    inline value_type&          front()                         { return at(0); }
+    inline const value_type&    front() const                   { return at(0); }
+    inline value_type&          back()                          { IM_ASSERT(Size > 0); return at(Size-1); }
+    inline const value_type&    back() const                    { IM_ASSERT(Size > 0); return at(Size-1); }
+    inline void                 swap(ImVector<T>& rhs)          { const size_t rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; const size_t rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
+
+    inline void                 reserve(size_t new_capacity)    { Data = (value_type*)realloc(Data, new_capacity * sizeof(value_type)); Capacity = new_capacity; }
+    inline void                 resize(size_t new_size)         { if (new_size > Capacity) reserve(new_size); Size = new_size; }
+
+    inline void                 push_back(const value_type& v)  { if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); Data[Size++] = v; }
+    inline void                 pop_back()                      { IM_ASSERT(Size > 0); Size--; }
+
+    inline iterator             erase(const_iterator it)        { IM_ASSERT(it >= begin() && it < end()); const int off = it - begin(); memmove(Data + off, Data + off + 1, (Size - off - 1) * sizeof(value_type)); Size--; return Data + off; }
+    inline void                 insert(const_iterator it, const value_type& v)  { IM_ASSERT(it >= begin() && it <= end()); const int off = it - begin(); if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4); if (off < (int)Size) memmove(Data + off + 1, Data + off, (Size - off) * sizeof(value_type)); Data[off] = v; Size++; }
 };
 };
 #endif // #ifndef ImVector
 #endif // #ifndef ImVector
 
 
 // Helpers at bottom of the file:
 // Helpers at bottom of the file:
-// - if (IMGUI_ONCE_UPON_A_FRAME)		// Execute a block of code once per frame only
-// - struct ImGuiTextFilter				// Parse and apply text filter. In format "aaaaa[,bbbb][,ccccc]"
-// - struct ImGuiTextBuffer				// Text buffer for logging/accumulating text
-// - struct ImGuiStorage				// Custom key value storage (if you need to alter open/close states manually)
-// - struct ImDrawList					// Draw command list
-// - struct ImBitmapFont				// Bitmap font loader
+// - if (IMGUI_ONCE_UPON_A_FRAME)       // Execute a block of code once per frame only
+// - struct ImGuiTextFilter             // Parse and apply text filter. In format "aaaaa[,bbbb][,ccccc]"
+// - struct ImGuiTextBuffer             // Text buffer for logging/accumulating text
+// - struct ImGuiStorage                // Custom key value storage (if you need to alter open/close states manually)
+// - struct ImDrawList                  // Draw command list
+// - struct ImBitmapFont                // Bitmap font loader
 
 
 // ImGui End-user API
 // ImGui End-user API
 // In a namespace so that user can add extra functions (e.g. Value() helpers for your vector or common types)
 // In a namespace so that user can add extra functions (e.g. Value() helpers for your vector or common types)
 namespace ImGui
 namespace ImGui
 {
 {
-	// Main
-	ImGuiIO&	GetIO();
-	ImGuiStyle&	GetStyle();
-	void		NewFrame();
-	void		Render();
-	void		Shutdown();
-	void		ShowUserGuide();
-	void		ShowStyleEditor(ImGuiStyle* ref = NULL);
-	void		ShowTestWindow(bool* open = NULL);
-
-	// Window
-	bool		Begin(const char* name = "Debug", bool* open = NULL, ImVec2 size = ImVec2(0,0), float fill_alpha = -1.0f, ImGuiWindowFlags flags = 0);
-	void		End();
-	void		BeginChild(const char* str_id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);
-	void		EndChild();
-	bool		GetWindowIsFocused();
-	float		GetWindowWidth();
-	ImVec2		GetWindowPos();														// you should rarely need/care about the window position, but it can be useful if you want to use your own drawing
-	void		SetWindowPos(const ImVec2& pos);									// set current window pos
-	ImVec2		GetWindowSize();
-	ImVec2		GetWindowContentRegionMin();
-	ImVec2		GetWindowContentRegionMax();
-	ImDrawList*	GetWindowDrawList();
-	void		SetFontScale(float scale);
-	void		SetScrollPosHere();
-	void		SetTreeStateStorage(ImGuiStorage* tree);
-	ImGuiStorage* GetTreeStateStorage();
-	void		PushItemWidth(float item_width);
-	void		PopItemWidth();
-	float		GetItemWidth();
-	void		PushAllowKeyboardFocus(bool v);
-	void		PopAllowKeyboardFocus();
-	void		PushStyleColor(ImGuiCol idx, const ImVec4& col);
-	void		PopStyleColor();
-
-	// Tooltip
-	void		SetTooltip(const char* fmt, ...);									// set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins.
-	void		BeginTooltip();														// use to create full-featured tooltip windows that aren't just text. 
-	void		EndTooltip();
-
-	// Layout
-	void		Separator();														// horizontal line
-	void		SameLine(int column_x = 0, int spacing_w = -1);						// call between widgets to layout them horizontally
-	void		Spacing();
-	void		Columns(int count = 1, const char* id = NULL, bool border=true);	// setup number of columns
-	void		NextColumn();														// next column
-	float		GetColumnOffset(int column_index = -1);
-	void		SetColumnOffset(int column_index, float offset);
-	float		GetColumnWidth(int column_index = -1);
-	ImVec2		GetCursorPos();														// cursor position is relative to window position
-	void		SetCursorPos(const ImVec2& pos);									// "
-	void		AlignFirstTextHeightToWidgets();									// call once if the first item on the line is a Text() item and you want to vertically lower it to match higher widgets.
-	float		GetTextLineSpacing();
-	float		GetTextLineHeight();
-
-	// ID scopes
-	void		PushID(const char* str_id);
-	void		PushID(const void* ptr_id);
-	void		PushID(const int int_id);
-	void		PopID();
-
-	// Widgets
-	void		Text(const char* fmt, ...);
-	void		TextV(const char* fmt, va_list args);
-	void		TextColored(const ImVec4& col, const char* fmt, ...);				// shortcut to doing PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
-	void		TextUnformatted(const char* text, const char* text_end = NULL);		// doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, better for long chunks of text.
-	void		LabelText(const char* label, const char* fmt, ...);
-	void		BulletText(const char* fmt, ...);
-	bool		Button(const char* label, ImVec2 size = ImVec2(0,0), bool repeat_when_held = false);
-	bool		SmallButton(const char* label);
-	bool		CollapsingHeader(const char* label, const char* str_id = NULL, const bool display_frame = true, const bool default_open = false);
-	bool		SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
-	bool		SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
-	bool		SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
-	bool		SliderFloat4(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
-	bool		SliderAngle(const char* label, float* v, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);		// *v in radians
-	bool		SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
-	void		PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
-	void		PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
-	void		Checkbox(const char* label, bool* v);
-	void		CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
-	bool		RadioButton(const char* label, bool active);
-	bool		RadioButton(const char* label, int* v, int v_button);
-	bool		InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1);
-	bool		InputFloat2(const char* label, float v[2], int decimal_precision = -1);
-	bool		InputFloat3(const char* label, float v[3], int decimal_precision = -1);
-	bool		InputFloat4(const char* label, float v[4], int decimal_precision = -1);
-	bool		InputInt(const char* label, int* v, int step = 1, int step_fast = 100);
-	bool		InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0);
-	bool		Combo(const char* label, int* current_item, const char** items, int items_count, int popup_height_items = 7);
-	bool		Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_height_items = 7);		// Separate items with \0, end item-list with \0\0
-	bool		Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_height_items = 7);
-	bool		ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
-	bool		ColorEdit3(const char* label, float col[3]);
-	bool		ColorEdit4(const char* label, float col[4], bool show_alpha = true);
-	void		ColorEditMode(ImGuiColorEditMode mode);
-	bool		TreeNode(const char* str_label_id);									// if returning 'true' the user is responsible for calling TreePop
-	bool		TreeNode(const char* str_id, const char* fmt, ...);					// "
-	bool		TreeNode(const void* ptr_id, const char* fmt, ...);					// "
-	void		TreePush(const char* str_id = NULL);								// already called by TreeNode(), but you can call Push/Pop yourself for layout purpose
-	void		TreePush(const void* ptr_id = NULL);								// "
-	void		TreePop();
-	void		OpenNextNode(bool open);											// force open/close the next TreeNode or CollapsingHeader
-
-	// Value helper output "name: value"
-	// Freely declare your own in the ImGui namespace.
-	void		Value(const char* prefix, bool b);
-	void		Value(const char* prefix, int v);
-	void		Value(const char* prefix, unsigned int v);
-	void		Value(const char* prefix, float v, const char* float_format = NULL);
-	void		Color(const char* prefix, const ImVec4& v);
-	void		Color(const char* prefix, unsigned int v);
-
-	// Logging
-	void		LogButtons();
-	void		LogToTTY(int max_depth = -1);
-	void		LogToFile(int max_depth = -1, const char* filename = NULL);
-	void		LogToClipboard(int max_depth = -1);
-
-	// Utilities
-	void		SetNewWindowDefaultPos(const ImVec2& pos);							// set position of window that do
-	bool		IsHovered();														// was the last item active area hovered by mouse?
-	ImVec2		GetItemBoxMin();													// get bounding box of last item
-	ImVec2		GetItemBoxMax();													// get bounding box of last item
-	bool		IsClipped(const ImVec2& item_size);									// to perform coarse clipping on user's side (as an optimisation)
-	bool		IsKeyPressed(int key_index, bool repeat = true);					// key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
-	bool		IsMouseClicked(int button, bool repeat = false);
-	bool		IsMouseDoubleClicked(int button);
-	bool		IsMouseHoveringBox(const ImVec2& box_min, const ImVec2& box_max);
-	ImVec2		GetMousePos();
-	float		GetTime();
-	int			GetFrameCount();
-	const char*	GetStyleColorName(ImGuiCol idx);
-	void		GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
+    // Main
+    ImGuiIO&    GetIO();
+    ImGuiStyle& GetStyle();
+    void        NewFrame();
+    void        Render();
+    void        Shutdown();
+    void        ShowUserGuide();
+    void        ShowStyleEditor(ImGuiStyle* ref = NULL);
+    void        ShowTestWindow(bool* open = NULL);
+
+    // Window
+    bool        Begin(const char* name = "Debug", bool* open = NULL, ImVec2 size = ImVec2(0,0), float fill_alpha = -1.0f, ImGuiWindowFlags flags = 0);
+    void        End();
+    void        BeginChild(const char* str_id, ImVec2 size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0);
+    void        EndChild();
+    bool        GetWindowIsFocused();
+    float       GetWindowWidth();
+    ImVec2      GetWindowPos();                                                     // you should rarely need/care about the window position, but it can be useful if you want to use your own drawing
+    void        SetWindowPos(const ImVec2& pos);                                    // set current window pos
+    ImVec2      GetWindowSize();
+    ImVec2      GetWindowContentRegionMin();
+    ImVec2      GetWindowContentRegionMax();
+    ImDrawList* GetWindowDrawList();
+    void        SetFontScale(float scale);
+    void        SetScrollPosHere();
+    void        SetTreeStateStorage(ImGuiStorage* tree);
+    ImGuiStorage* GetTreeStateStorage();
+    void        PushItemWidth(float item_width);
+    void        PopItemWidth();
+    float       GetItemWidth();
+    void        PushAllowKeyboardFocus(bool v);
+    void        PopAllowKeyboardFocus();
+    void        PushStyleColor(ImGuiCol idx, const ImVec4& col);
+    void        PopStyleColor();
+
+    // Tooltip
+    void        SetTooltip(const char* fmt, ...);                                   // set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins.
+    void        BeginTooltip();                                                     // use to create full-featured tooltip windows that aren't just text. 
+    void        EndTooltip();
+
+    // Layout
+    void        Separator();                                                        // horizontal line
+    void        SameLine(int column_x = 0, int spacing_w = -1);                     // call between widgets to layout them horizontally
+    void        Spacing();
+    void        Columns(int count = 1, const char* id = NULL, bool border=true);    // setup number of columns
+    void        NextColumn();                                                       // next column
+    float       GetColumnOffset(int column_index = -1);
+    void        SetColumnOffset(int column_index, float offset);
+    float       GetColumnWidth(int column_index = -1);
+    ImVec2      GetCursorPos();                                                     // cursor position is relative to window position
+    void        SetCursorPos(const ImVec2& pos);                                    // "
+    void        AlignFirstTextHeightToWidgets();                                    // call once if the first item on the line is a Text() item and you want to vertically lower it to match higher widgets.
+    float       GetTextLineSpacing();
+    float       GetTextLineHeight();
+
+    // ID scopes
+    void        PushID(const char* str_id);
+    void        PushID(const void* ptr_id);
+    void        PushID(const int int_id);
+    void        PopID();
+
+    // Widgets
+    void        Text(const char* fmt, ...);
+    void        TextV(const char* fmt, va_list args);
+    void        TextColored(const ImVec4& col, const char* fmt, ...);               // shortcut to doing PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
+    void        TextUnformatted(const char* text, const char* text_end = NULL);     // doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, better for long chunks of text.
+    void        LabelText(const char* label, const char* fmt, ...);
+    void        BulletText(const char* fmt, ...);
+    bool        Button(const char* label, ImVec2 size = ImVec2(0,0), bool repeat_when_held = false);
+    bool        SmallButton(const char* label);
+    bool        CollapsingHeader(const char* label, const char* str_id = NULL, const bool display_frame = true, const bool default_open = false);
+    bool        SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
+    bool        SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
+    bool        SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
+    bool        SliderFloat4(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
+    bool        SliderAngle(const char* label, float* v, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);     // *v in radians
+    bool        SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
+    void        PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
+    void        PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
+    void        Checkbox(const char* label, bool* v);
+    void        CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
+    bool        RadioButton(const char* label, bool active);
+    bool        RadioButton(const char* label, int* v, int v_button);
+    bool        InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1);
+    bool        InputFloat2(const char* label, float v[2], int decimal_precision = -1);
+    bool        InputFloat3(const char* label, float v[3], int decimal_precision = -1);
+    bool        InputFloat4(const char* label, float v[4], int decimal_precision = -1);
+    bool        InputInt(const char* label, int* v, int step = 1, int step_fast = 100);
+    bool        InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0);
+    bool        Combo(const char* label, int* current_item, const char** items, int items_count, int popup_height_items = 7);
+    bool        Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_height_items = 7);      // Separate items with \0, end item-list with \0\0
+    bool        Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_height_items = 7);
+    bool        ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
+    bool        ColorEdit3(const char* label, float col[3]);
+    bool        ColorEdit4(const char* label, float col[4], bool show_alpha = true);
+    void        ColorEditMode(ImGuiColorEditMode mode);
+    bool        TreeNode(const char* str_label_id);                                 // if returning 'true' the user is responsible for calling TreePop
+    bool        TreeNode(const char* str_id, const char* fmt, ...);                 // "
+    bool        TreeNode(const void* ptr_id, const char* fmt, ...);                 // "
+    void        TreePush(const char* str_id = NULL);                                // already called by TreeNode(), but you can call Push/Pop yourself for layout purpose
+    void        TreePush(const void* ptr_id = NULL);                                // "
+    void        TreePop();
+    void        OpenNextNode(bool open);                                            // force open/close the next TreeNode or CollapsingHeader
+
+    // Value helper output "name: value"
+    // Freely declare your own in the ImGui namespace.
+    void        Value(const char* prefix, bool b);
+    void        Value(const char* prefix, int v);
+    void        Value(const char* prefix, unsigned int v);
+    void        Value(const char* prefix, float v, const char* float_format = NULL);
+    void        Color(const char* prefix, const ImVec4& v);
+    void        Color(const char* prefix, unsigned int v);
+
+    // Logging
+    void        LogButtons();
+    void        LogToTTY(int max_depth = -1);
+    void        LogToFile(int max_depth = -1, const char* filename = NULL);
+    void        LogToClipboard(int max_depth = -1);
+
+    // Utilities
+    void        SetNewWindowDefaultPos(const ImVec2& pos);                          // set position of window that do
+    bool        IsHovered();                                                        // was the last item active area hovered by mouse?
+    ImVec2      GetItemBoxMin();                                                    // get bounding box of last item
+    ImVec2      GetItemBoxMax();                                                    // get bounding box of last item
+    bool        IsClipped(const ImVec2& item_size);                                 // to perform coarse clipping on user's side (as an optimisation)
+    bool        IsKeyPressed(int key_index, bool repeat = true);                    // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
+    bool        IsMouseClicked(int button, bool repeat = false);
+    bool        IsMouseDoubleClicked(int button);
+    bool        IsMouseHoveringBox(const ImVec2& box_min, const ImVec2& box_max);
+    ImVec2      GetMousePos();
+    float       GetTime();
+    int         GetFrameCount();
+    const char* GetStyleColorName(ImGuiCol idx);
+    void        GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
 
 
 }; // namespace ImGui
 }; // namespace ImGui
 
 
 // Flags for ImGui::Begin()
 // Flags for ImGui::Begin()
 enum ImGuiWindowFlags_
 enum ImGuiWindowFlags_
 {
 {
-	// Default: 0
-	ImGuiWindowFlags_ShowBorders			= 1 << 0,
-	ImGuiWindowFlags_NoTitleBar				= 1 << 1,
-	ImGuiWindowFlags_NoResize				= 1 << 2,
-	ImGuiWindowFlags_NoMove					= 1 << 3,
-	ImGuiWindowFlags_NoScrollbar			= 1 << 4,
-	ImGuiWindowFlags_ChildWindow			= 1 << 5,	// For internal use by BeginChild()
-	ImGuiWindowFlags_ChildWindowAutoFitX	= 1 << 6,	// For internal use by BeginChild()
-	ImGuiWindowFlags_ChildWindowAutoFitY	= 1 << 7,	// For internal use by BeginChild()
-	ImGuiWindowFlags_ComboBox				= 1 << 8,	// For internal use by ComboBox()
-	ImGuiWindowFlags_Tooltip				= 1 << 9,	// For internal use by Render() when using Tooltip
+    // Default: 0
+    ImGuiWindowFlags_ShowBorders            = 1 << 0,
+    ImGuiWindowFlags_NoTitleBar             = 1 << 1,
+    ImGuiWindowFlags_NoResize               = 1 << 2,
+    ImGuiWindowFlags_NoMove                 = 1 << 3,
+    ImGuiWindowFlags_NoScrollbar            = 1 << 4,
+    ImGuiWindowFlags_ChildWindow            = 1 << 5,   // For internal use by BeginChild()
+    ImGuiWindowFlags_ChildWindowAutoFitX    = 1 << 6,   // For internal use by BeginChild()
+    ImGuiWindowFlags_ChildWindowAutoFitY    = 1 << 7,   // For internal use by BeginChild()
+    ImGuiWindowFlags_ComboBox               = 1 << 8,   // For internal use by ComboBox()
+    ImGuiWindowFlags_Tooltip                = 1 << 9,   // For internal use by Render() when using Tooltip
 };
 };
 
 
 // Flags for ImGui::InputText()
 // Flags for ImGui::InputText()
 enum ImGuiInputTextFlags_
 enum ImGuiInputTextFlags_
 {
 {
-	// Default: 0
-	ImGuiInputTextFlags_CharsDecimal		= 1 << 0,
-	ImGuiInputTextFlags_CharsHexadecimal	= 1 << 1,
-	ImGuiInputTextFlags_AutoSelectAll		= 1 << 2,
-	ImGuiInputTextFlags_AlignCenter			= 1 << 3,
+    // Default: 0
+    ImGuiInputTextFlags_CharsDecimal        = 1 << 0,
+    ImGuiInputTextFlags_CharsHexadecimal    = 1 << 1,
+    ImGuiInputTextFlags_AutoSelectAll       = 1 << 2,
+    ImGuiInputTextFlags_AlignCenter         = 1 << 3,
 };
 };
 
 
 // User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
 // User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
 enum ImGuiKey_
 enum ImGuiKey_
 {
 {
-	ImGuiKey_Tab,
-	ImGuiKey_LeftArrow,
-	ImGuiKey_RightArrow,
-	ImGuiKey_UpArrow,
-	ImGuiKey_DownArrow,
-	ImGuiKey_Home,
-	ImGuiKey_End,
-	ImGuiKey_Delete,
-	ImGuiKey_Backspace,
-	ImGuiKey_Enter,
-	ImGuiKey_Escape,
-	ImGuiKey_A,			// for CTRL+A: select all
-	ImGuiKey_C,			// for CTRL+C: copy
-	ImGuiKey_V,			// for CTRL+V: paste
-	ImGuiKey_X,			// for CTRL+X: cut
-	ImGuiKey_Y,			// for CTRL+Y: redo
-	ImGuiKey_Z,			// for CTRL+Z: undo
-	ImGuiKey_COUNT,
+    ImGuiKey_Tab,
+    ImGuiKey_LeftArrow,
+    ImGuiKey_RightArrow,
+    ImGuiKey_UpArrow,
+    ImGuiKey_DownArrow,
+    ImGuiKey_Home,
+    ImGuiKey_End,
+    ImGuiKey_Delete,
+    ImGuiKey_Backspace,
+    ImGuiKey_Enter,
+    ImGuiKey_Escape,
+    ImGuiKey_A,         // for CTRL+A: select all
+    ImGuiKey_C,         // for CTRL+C: copy
+    ImGuiKey_V,         // for CTRL+V: paste
+    ImGuiKey_X,         // for CTRL+X: cut
+    ImGuiKey_Y,         // for CTRL+Y: redo
+    ImGuiKey_Z,         // for CTRL+Z: undo
+    ImGuiKey_COUNT,
 };
 };
 
 
 enum ImGuiCol_
 enum ImGuiCol_
 {
 {
-	ImGuiCol_Text,
-	ImGuiCol_WindowBg,
-	ImGuiCol_Border,
-	ImGuiCol_BorderShadow,
-	ImGuiCol_FrameBg,				// Background of checkbox, radio button, plot, slider, text input
-	ImGuiCol_TitleBg,
-	ImGuiCol_TitleBgCollapsed,
-	ImGuiCol_ScrollbarBg,
-	ImGuiCol_ScrollbarGrab,
-	ImGuiCol_ScrollbarGrabHovered,
-	ImGuiCol_ScrollbarGrabActive,
-	ImGuiCol_ComboBg,
-	ImGuiCol_CheckHovered,
-	ImGuiCol_CheckActive,
-	ImGuiCol_SliderGrab,
-	ImGuiCol_SliderGrabActive,
-	ImGuiCol_Button,
-	ImGuiCol_ButtonHovered,
-	ImGuiCol_ButtonActive,
-	ImGuiCol_Header,
-	ImGuiCol_HeaderHovered,
-	ImGuiCol_HeaderActive,
-	ImGuiCol_Column,
-	ImGuiCol_ColumnHovered,
-	ImGuiCol_ColumnActive,
-	ImGuiCol_ResizeGrip,
-	ImGuiCol_ResizeGripHovered,
-	ImGuiCol_ResizeGripActive,
-	ImGuiCol_CloseButton,
-	ImGuiCol_CloseButtonHovered,
-	ImGuiCol_CloseButtonActive,
-	ImGuiCol_PlotLines,
-	ImGuiCol_PlotLinesHovered,
-	ImGuiCol_PlotHistogram,
-	ImGuiCol_PlotHistogramHovered,
-	ImGuiCol_TextSelectedBg,
-	ImGuiCol_TooltipBg,
-	ImGuiCol_COUNT,
+    ImGuiCol_Text,
+    ImGuiCol_WindowBg,
+    ImGuiCol_Border,
+    ImGuiCol_BorderShadow,
+    ImGuiCol_FrameBg,               // Background of checkbox, radio button, plot, slider, text input
+    ImGuiCol_TitleBg,
+    ImGuiCol_TitleBgCollapsed,
+    ImGuiCol_ScrollbarBg,
+    ImGuiCol_ScrollbarGrab,
+    ImGuiCol_ScrollbarGrabHovered,
+    ImGuiCol_ScrollbarGrabActive,
+    ImGuiCol_ComboBg,
+    ImGuiCol_CheckHovered,
+    ImGuiCol_CheckActive,
+    ImGuiCol_SliderGrab,
+    ImGuiCol_SliderGrabActive,
+    ImGuiCol_Button,
+    ImGuiCol_ButtonHovered,
+    ImGuiCol_ButtonActive,
+    ImGuiCol_Header,
+    ImGuiCol_HeaderHovered,
+    ImGuiCol_HeaderActive,
+    ImGuiCol_Column,
+    ImGuiCol_ColumnHovered,
+    ImGuiCol_ColumnActive,
+    ImGuiCol_ResizeGrip,
+    ImGuiCol_ResizeGripHovered,
+    ImGuiCol_ResizeGripActive,
+    ImGuiCol_CloseButton,
+    ImGuiCol_CloseButtonHovered,
+    ImGuiCol_CloseButtonActive,
+    ImGuiCol_PlotLines,
+    ImGuiCol_PlotLinesHovered,
+    ImGuiCol_PlotHistogram,
+    ImGuiCol_PlotHistogramHovered,
+    ImGuiCol_TextSelectedBg,
+    ImGuiCol_TooltipBg,
+    ImGuiCol_COUNT,
 };
 };
 
 
 enum ImGuiColorEditMode_
 enum ImGuiColorEditMode_
 {
 {
-	ImGuiColorEditMode_UserSelect = -1,
-	ImGuiColorEditMode_RGB = 0,
-	ImGuiColorEditMode_HSV = 1,
-	ImGuiColorEditMode_HEX = 2,
+    ImGuiColorEditMode_UserSelect = -1,
+    ImGuiColorEditMode_RGB = 0,
+    ImGuiColorEditMode_HSV = 1,
+    ImGuiColorEditMode_HEX = 2,
 };
 };
 
 
 struct ImGuiStyle
 struct ImGuiStyle
 {
 {
-	float		Alpha;						// Global alpha applies to everything in ImGui
-	ImVec2		WindowPadding;				// Padding within a window
-	ImVec2		WindowMinSize;				// Minimum window size
-	ImVec2		FramePadding;				// Padding within a framed rectangle (used by most widgets)
-	ImVec2		ItemSpacing;				// Horizontal and vertical spacing between widgets/lines
-	ImVec2		ItemInnerSpacing;			// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
-	ImVec2		TouchExtraPadding;			// Expand bounding box for touch-based system where touch position is not accurate enough (unnecessary for mouse inputs). Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget running. So dont grow this too much!
-	ImVec2		AutoFitPadding;				// Extra space after auto-fit (double-clicking on resize grip)
-	float		WindowFillAlphaDefault;		// Default alpha of window background, if not specified in ImGui::Begin()
-	float		WindowRounding;				// Radius of window corners rounding. Set to 0.0f to have rectangular windows
-	float		TreeNodeSpacing;			// Horizontal spacing when entering a tree node
-	float		ColumnsMinSpacing;			// Minimum horizontal spacing between two columns
-	float		ScrollBarWidth;				// Width of the vertical scroll bar
-	ImVec4		Colors[ImGuiCol_COUNT];
-
-	ImGuiStyle();
+    float       Alpha;                      // Global alpha applies to everything in ImGui
+    ImVec2      WindowPadding;              // Padding within a window
+    ImVec2      WindowMinSize;              // Minimum window size
+    ImVec2      FramePadding;               // Padding within a framed rectangle (used by most widgets)
+    ImVec2      ItemSpacing;                // Horizontal and vertical spacing between widgets/lines
+    ImVec2      ItemInnerSpacing;           // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
+    ImVec2      TouchExtraPadding;          // Expand bounding box for touch-based system where touch position is not accurate enough (unnecessary for mouse inputs). Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget running. So dont grow this too much!
+    ImVec2      AutoFitPadding;             // Extra space after auto-fit (double-clicking on resize grip)
+    float       WindowFillAlphaDefault;     // Default alpha of window background, if not specified in ImGui::Begin()
+    float       WindowRounding;             // Radius of window corners rounding. Set to 0.0f to have rectangular windows
+    float       TreeNodeSpacing;            // Horizontal spacing when entering a tree node
+    float       ColumnsMinSpacing;          // Minimum horizontal spacing between two columns
+    float       ScrollBarWidth;             // Width of the vertical scroll bar
+    ImVec4      Colors[ImGuiCol_COUNT];
+
+    ImGuiStyle();
 };
 };
 
 
 // This is where your app communicate with ImGui. Call ImGui::GetIO() to access.
 // This is where your app communicate with ImGui. Call ImGui::GetIO() to access.
 // Read 'Programmer guide' section in .cpp file for general usage.
 // Read 'Programmer guide' section in .cpp file for general usage.
 struct ImGuiIO
 struct ImGuiIO
 {
 {
-	// Settings (fill once)					// Default value:
-	ImVec2		DisplaySize;				// <unset>					// Display size, in pixels. For clamping windows positions.
-	float		DeltaTime;					// = 1.0f/60.0f				// Time elapsed since last frame, in seconds.
-	float		IniSavingRate;				// = 5.0f					// Maximum time between saving .ini file, in seconds. Set to a negative value to disable .ini saving.
-	const char* IniFilename;				// = "imgui.ini"			// Absolute path to .ini file.
-	const char*	LogFilename;				// = "imgui_log.txt"		// Absolute path to .log file.
-	float		MouseDoubleClickTime;		// = 0.30f					// Time for a double-click, in seconds.
-	float		MouseDoubleClickMaxDist;	// = 6.0f					// Distance threshold to stay in to validate a double-click, in pixels.
-	int			KeyMap[ImGuiKey_COUNT];		// <unset>					// Map of indices into the KeysDown[512] entries array
-	ImFont		Font;						// <auto>					// Gets passed to text functions. Typedef ImFont to the type you want (ImBitmapFont* or your own font).
-	float		FontHeight;					// <auto>					// Default font height, must be the vertical distance between two lines of text, aka == CalcTextSize(" ").y
-	bool		FontAllowScaling;			// = false					// Set to allow scaling text with CTRL+Wheel.
-	float		PixelCenterOffset;			// = 0.5f					// Set to 0.0f for DirectX <= 9, 0.5f for Direct3D >= 10 and OpenGL.
-
-	// Settings - Rendering function (REQUIRED)
-	// See example code if you are unsure of how to implement this.
-	void		(*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
-
-	// Settings - Clipboard Support
-	// Override to provide your clipboard handlers.
-	// On Windows architecture, defaults to use the native Win32 clipboard, otherwise default to use a ImGui private clipboard. 
-	// NB- for SetClipboardTextFn, the string is *NOT* zero-terminated at 'text_end'
-	const char*	(*GetClipboardTextFn)();										
-	void		(*SetClipboardTextFn)(const char* text, const char* text_end);
-
-	// Input - Fill before calling NewFrame()
-	ImVec2		MousePos;					// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
-	bool		MouseDown[5];				// Mouse buttons. ImGui itself only uses button 0 (left button) but you can use others as storage for convenience.
-	int			MouseWheel;					// Mouse wheel: -1,0,+1
-	bool		KeyCtrl;					// Keyboard modifier pressed: Control
-	bool		KeyShift;					// Keyboard modifier pressed: Shift
-	bool		KeysDown[512];				// Keyboard keys that are pressed (in whatever order user naturally has access to keyboard data)
-	char		InputCharacters[16];		// List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
-
-	// Output - Retrieve after calling NewFrame(), you can use them to discard inputs or hide them from the rest of your application
-	bool		WantCaptureMouse;			// ImGui is using your mouse input (= window is being hovered or widget is active).
-	bool		WantCaptureKeyboard;		// imGui is using your keyboard input (= widget is active).
-
-	// Function
-	void		AddInputCharacter(char c);	// Helper to add a new character into InputCharacters[]
-
-	// [Internal] ImGui will maintain those fields for you
-	ImVec2		MousePosPrev;
-	ImVec2		MouseDelta;
-	bool		MouseClicked[5];
-	ImVec2		MouseClickedPos[5];
-	float		MouseClickedTime[5];
-	bool		MouseDoubleClicked[5];
-	float		MouseDownTime[5];
-	float		KeysDownTime[512];
-
-	ImGuiIO();
+    // Settings (fill once)                 // Default value:
+    ImVec2      DisplaySize;                // <unset>                  // Display size, in pixels. For clamping windows positions.
+    float       DeltaTime;                  // = 1.0f/60.0f             // Time elapsed since last frame, in seconds.
+    float       IniSavingRate;              // = 5.0f                   // Maximum time between saving .ini file, in seconds. Set to a negative value to disable .ini saving.
+    const char* IniFilename;                // = "imgui.ini"            // Absolute path to .ini file.
+    const char* LogFilename;                // = "imgui_log.txt"        // Absolute path to .log file.
+    float       MouseDoubleClickTime;       // = 0.30f                  // Time for a double-click, in seconds.
+    float       MouseDoubleClickMaxDist;    // = 6.0f                   // Distance threshold to stay in to validate a double-click, in pixels.
+    int         KeyMap[ImGuiKey_COUNT];     // <unset>                  // Map of indices into the KeysDown[512] entries array
+    ImFont      Font;                       // <auto>                   // Gets passed to text functions. Typedef ImFont to the type you want (ImBitmapFont* or your own font).
+    float       FontHeight;                 // <auto>                   // Default font height, must be the vertical distance between two lines of text, aka == CalcTextSize(" ").y
+    bool        FontAllowScaling;           // = false                  // Set to allow scaling text with CTRL+Wheel.
+    float       PixelCenterOffset;          // = 0.5f                   // Set to 0.0f for DirectX <= 9, 0.5f for Direct3D >= 10 and OpenGL.
+
+    // Settings - Rendering function (REQUIRED)
+    // See example code if you are unsure of how to implement this.
+    void        (*RenderDrawListsFn)(ImDrawList** const draw_lists, int count);
+
+    // Settings - Clipboard Support
+    // Override to provide your clipboard handlers.
+    // On Windows architecture, defaults to use the native Win32 clipboard, otherwise default to use a ImGui private clipboard. 
+    // NB- for SetClipboardTextFn, the string is *NOT* zero-terminated at 'text_end'
+    const char* (*GetClipboardTextFn)();                                        
+    void        (*SetClipboardTextFn)(const char* text, const char* text_end);
+
+    // Input - Fill before calling NewFrame()
+    ImVec2      MousePos;                   // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
+    bool        MouseDown[5];               // Mouse buttons. ImGui itself only uses button 0 (left button) but you can use others as storage for convenience.
+    int         MouseWheel;                 // Mouse wheel: -1,0,+1
+    bool        KeyCtrl;                    // Keyboard modifier pressed: Control
+    bool        KeyShift;                   // Keyboard modifier pressed: Shift
+    bool        KeysDown[512];              // Keyboard keys that are pressed (in whatever order user naturally has access to keyboard data)
+    char        InputCharacters[16];        // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
+
+    // Output - Retrieve after calling NewFrame(), you can use them to discard inputs or hide them from the rest of your application
+    bool        WantCaptureMouse;           // ImGui is using your mouse input (= window is being hovered or widget is active).
+    bool        WantCaptureKeyboard;        // imGui is using your keyboard input (= widget is active).
+
+    // Function
+    void        AddInputCharacter(char c);  // Helper to add a new character into InputCharacters[]
+
+    // [Internal] ImGui will maintain those fields for you
+    ImVec2      MousePosPrev;
+    ImVec2      MouseDelta;
+    bool        MouseClicked[5];
+    ImVec2      MouseClickedPos[5];
+    float       MouseClickedTime[5];
+    bool        MouseDoubleClicked[5];
+    float       MouseDownTime[5];
+    float       KeysDownTime[512];
+
+    ImGuiIO();
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -437,59 +437,59 @@ struct ImGuiIO
 
 
 // Helper: execute a block of code once a frame only
 // Helper: execute a block of code once a frame only
 // Usage: if (IMGUI_ONCE_UPON_A_FRAME) {/*do something once a frame*/)
 // Usage: if (IMGUI_ONCE_UPON_A_FRAME) {/*do something once a frame*/)
-#define IMGUI_ONCE_UPON_A_FRAME			static ImGuiOncePerFrame im = ImGuiOncePerFrame()
+#define IMGUI_ONCE_UPON_A_FRAME         static ImGuiOncePerFrame im = ImGuiOncePerFrame()
 struct ImGuiOncePerFrame
 struct ImGuiOncePerFrame
 {
 {
-	ImGuiOncePerFrame() : LastFrame(-1) {}
-	operator bool() const { return TryIsNewFrame(); }
+    ImGuiOncePerFrame() : LastFrame(-1) {}
+    operator bool() const { return TryIsNewFrame(); }
 private:
 private:
-	mutable int LastFrame;
-	bool		TryIsNewFrame() const	{ const int current_frame = ImGui::GetFrameCount(); if (LastFrame == current_frame) return false; LastFrame = current_frame; return true; }
+    mutable int LastFrame;
+    bool        TryIsNewFrame() const   { const int current_frame = ImGui::GetFrameCount(); if (LastFrame == current_frame) return false; LastFrame = current_frame; return true; }
 };
 };
 
 
 // Helper: Parse and apply text filter. In format "aaaaa[,bbbb][,ccccc]"
 // Helper: Parse and apply text filter. In format "aaaaa[,bbbb][,ccccc]"
 struct ImGuiTextFilter
 struct ImGuiTextFilter
 {
 {
-	struct TextRange 
-	{ 
-		const char* b; 
-		const char* e;
-
-		TextRange() { b = e = NULL; }
-		TextRange(const char* _b, const char* _e) { b = _b; e = _e; }
-		const char* begin() const { return b; }
-		const char* end() const { return e; }
-		bool empty() const { return b == e; }
-		char front() const { return *b; }
-		static bool isblank(char c) { return c == ' ' && c == '\t'; } 
-		void trim_blanks() { while (b < e && isblank(*b)) b++; while (e > b && isblank(*(e-1))) e--; }
-		void split(char separator, ImVector<TextRange>& out);
-	};
-
-	char				InputBuf[256];
-	ImVector<TextRange>	Filters;
-	int					CountGrep;
-
-	ImGuiTextFilter();
-	void Clear() { InputBuf[0] = 0; Build(); }
-	void Draw(const char* label = "Filter (inc,-exc)", float width = -1.0f);	// Helper calling InputText+Build
-	bool PassFilter(const char* val) const;
-	bool IsActive() const { return !Filters.empty(); }
-	void Build();
+    struct TextRange 
+    { 
+        const char* b; 
+        const char* e;
+
+        TextRange() { b = e = NULL; }
+        TextRange(const char* _b, const char* _e) { b = _b; e = _e; }
+        const char* begin() const { return b; }
+        const char* end() const { return e; }
+        bool empty() const { return b == e; }
+        char front() const { return *b; }
+        static bool isblank(char c) { return c == ' ' && c == '\t'; } 
+        void trim_blanks() { while (b < e && isblank(*b)) b++; while (e > b && isblank(*(e-1))) e--; }
+        void split(char separator, ImVector<TextRange>& out);
+    };
+
+    char                InputBuf[256];
+    ImVector<TextRange> Filters;
+    int                 CountGrep;
+
+    ImGuiTextFilter();
+    void Clear() { InputBuf[0] = 0; Build(); }
+    void Draw(const char* label = "Filter (inc,-exc)", float width = -1.0f);    // Helper calling InputText+Build
+    bool PassFilter(const char* val) const;
+    bool IsActive() const { return !Filters.empty(); }
+    void Build();
 };
 };
 
 
 // Helper: Text buffer for logging/accumulating text
 // Helper: Text buffer for logging/accumulating text
 struct ImGuiTextBuffer
 struct ImGuiTextBuffer
 {
 {
-	ImVector<char>		Buf;
-
-	ImGuiTextBuffer()	{ Buf.push_back(0); }
-	const char*			begin() const { return Buf.begin(); }
-	const char*			end() const { return Buf.end()-1; }
-	size_t				size() const { return Buf.size()-1; }
-	bool				empty() { return Buf.empty(); }
-	void				clear() { Buf.clear(); Buf.push_back(0); }
-	void				append(const char* fmt, ...);
+    ImVector<char>      Buf;
+
+    ImGuiTextBuffer()   { Buf.push_back(0); }
+    const char*         begin() const { return Buf.begin(); }
+    const char*         end() const { return Buf.end()-1; }
+    size_t              size() const { return Buf.size()-1; }
+    bool                empty() { return Buf.empty(); }
+    void                clear() { Buf.clear(); Buf.push_back(0); }
+    void                append(const char* fmt, ...);
 };
 };
 
 
 // Helper: Key->value storage
 // Helper: Key->value storage
@@ -499,16 +499,16 @@ struct ImGuiTextBuffer
 // Declare your own storage if you want to manipulate the open/close state of a particular sub-tree in your interface.
 // Declare your own storage if you want to manipulate the open/close state of a particular sub-tree in your interface.
 struct ImGuiStorage
 struct ImGuiStorage
 {
 {
-	struct Pair { ImU32 key; int val; };
-	ImVector<Pair>	Data;
+    struct Pair { ImU32 key; int val; };
+    ImVector<Pair>  Data;
 
 
-	void	Clear();
-	int		GetInt(ImU32 key, int default_val = 0);
-	void	SetInt(ImU32 key, int val);
-	void	SetAllInt(int val);
+    void    Clear();
+    int     GetInt(ImU32 key, int default_val = 0);
+    void    SetInt(ImU32 key, int val);
+    void    SetAllInt(int val);
 
 
-	int*	Find(ImU32 key);
-	void	Insert(ImU32 key, int val);
+    int*    Find(ImU32 key);
+    void    Insert(ImU32 key, int val);
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -518,56 +518,56 @@ struct ImGuiStorage
 
 
 struct ImDrawCmd
 struct ImDrawCmd
 {
 {
-	unsigned int	vtx_count;
-	ImVec4			clip_rect;
+    unsigned int    vtx_count;
+    ImVec4          clip_rect;
 };
 };
 
 
 #ifndef IMGUI_FONT_TEX_UV_FOR_WHITE
 #ifndef IMGUI_FONT_TEX_UV_FOR_WHITE
-#define IMGUI_FONT_TEX_UV_FOR_WHITE	ImVec2(0.f,0.f)
+#define IMGUI_FONT_TEX_UV_FOR_WHITE ImVec2(0.f,0.f)
 #endif
 #endif
 
 
 // sizeof() == 20
 // sizeof() == 20
 struct ImDrawVert
 struct ImDrawVert
 {
 {
-	ImVec2	pos;
-	ImVec2  uv;
-	ImU32	col;
+    ImVec2  pos;
+    ImVec2  uv;
+    ImU32   col;
 };
 };
 
 
 // Draw command list
 // Draw command list
 // User is responsible for providing a renderer for this in ImGuiIO::RenderDrawListFn
 // User is responsible for providing a renderer for this in ImGuiIO::RenderDrawListFn
 struct ImDrawList
 struct ImDrawList
 {
 {
-	// This is what you have to render
-	ImVector<ImDrawCmd>		commands;			// commands
-	ImVector<ImDrawVert>	vtx_buffer;			// each command consume ImDrawCmd::vtx_count of those
-
-	// [Internal to ImGui]
-	ImVector<ImVec4>		clip_rect_stack;	// [internal] clip rect stack while building the command-list (so text command can perform clipping early on)
-	ImDrawVert*				vtx_write;			// [internal] point within vtx_buffer after each add command (to avoid using the ImVector<> operators too much)
-
-	ImDrawList() { Clear(); }
-
-	void Clear();
-	void PushClipRect(const ImVec4& clip_rect);
-	void PopClipRect();
-	void ReserveVertices(unsigned int vtx_count);
-	void AddVtx(const ImVec2& pos, ImU32 col);
-	void AddVtxLine(const ImVec2& a, const ImVec2& b, ImU32 col);
-
-	// Primitives
-	void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col);
-	void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
-	void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
-	void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
-	void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
-	void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
-	void AddArc(const ImVec2& center, float rad, ImU32 col, int a_min, int a_max, bool tris=false, const ImVec2& third_point_offset = ImVec2(0,0));
-	void AddText(ImFont font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end);
+    // This is what you have to render
+    ImVector<ImDrawCmd>     commands;           // commands
+    ImVector<ImDrawVert>    vtx_buffer;         // each command consume ImDrawCmd::vtx_count of those
+
+    // [Internal to ImGui]
+    ImVector<ImVec4>        clip_rect_stack;    // [internal] clip rect stack while building the command-list (so text command can perform clipping early on)
+    ImDrawVert*             vtx_write;          // [internal] point within vtx_buffer after each add command (to avoid using the ImVector<> operators too much)
+
+    ImDrawList() { Clear(); }
+
+    void Clear();
+    void PushClipRect(const ImVec4& clip_rect);
+    void PopClipRect();
+    void ReserveVertices(unsigned int vtx_count);
+    void AddVtx(const ImVec2& pos, ImU32 col);
+    void AddVtxLine(const ImVec2& a, const ImVec2& b, ImU32 col);
+
+    // Primitives
+    void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col);
+    void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
+    void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
+    void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
+    void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
+    void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
+    void AddArc(const ImVec2& center, float rad, ImU32 col, int a_min, int a_max, bool tris=false, const ImVec2& third_point_offset = ImVec2(0,0));
+    void AddText(ImFont font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end);
 };
 };
 
 
 // Optional bitmap font data loader & renderer into vertices
 // Optional bitmap font data loader & renderer into vertices
-//	#define ImFont to ImBitmapFont to use
+//  #define ImFont to ImBitmapFont to use
 // Using the .fnt format exported by BMFont
 // Using the .fnt format exported by BMFont
 //  - tool: http://www.angelcode.com/products/bmfont
 //  - tool: http://www.angelcode.com/products/bmfont
 //  - file-format: http://www.angelcode.com/products/bmfont/doc/file_format.html
 //  - file-format: http://www.angelcode.com/products/bmfont/doc/file_format.html
@@ -577,71 +577,71 @@ struct ImDrawList
 struct ImBitmapFont
 struct ImBitmapFont
 {
 {
 #pragma pack(push, 1)
 #pragma pack(push, 1)
-	struct FntInfo
-	{
-		signed short	FontSize;
-		unsigned char	BitField;		// bit 0: smooth, bit 1: unicode, bit 2: italic, bit 3: bold, bit 4: fixedHeight, bits 5-7: reserved
-		unsigned char	CharSet;
-		unsigned short	StretchH;
-		unsigned char	AA;
-		unsigned char	PaddingUp, PaddingRight, PaddingDown, PaddingLeft;
-		unsigned char	SpacingHoriz, SpacingVert;
-		unsigned char	Outline;
-		//char			FontName[];
-	};
-
-	struct FntCommon
-	{
-		unsigned short	LineHeight;
-		unsigned short	Base;
-		unsigned short	ScaleW, ScaleH;
-		unsigned short	Pages;
-		unsigned char	BitField;
-		unsigned char	Channels[4];
-	};
-
-	struct FntGlyph
-	{
-		unsigned int	Id;
-		unsigned short	X, Y;
-		unsigned short	Width, Height;
-		signed short	XOffset, YOffset;
-		signed short	XAdvance;
-		unsigned char	Page;
-		unsigned char	Channel;
-	};
-
-	struct FntKerning
-	{
-		unsigned int	IdFirst;
-		unsigned int	IdSecond;
-		signed short	Amount;
-	};
+    struct FntInfo
+    {
+        signed short    FontSize;
+        unsigned char   BitField;       // bit 0: smooth, bit 1: unicode, bit 2: italic, bit 3: bold, bit 4: fixedHeight, bits 5-7: reserved
+        unsigned char   CharSet;
+        unsigned short  StretchH;
+        unsigned char   AA;
+        unsigned char   PaddingUp, PaddingRight, PaddingDown, PaddingLeft;
+        unsigned char   SpacingHoriz, SpacingVert;
+        unsigned char   Outline;
+        //char          FontName[];
+    };
+
+    struct FntCommon
+    {
+        unsigned short  LineHeight;
+        unsigned short  Base;
+        unsigned short  ScaleW, ScaleH;
+        unsigned short  Pages;
+        unsigned char   BitField;
+        unsigned char   Channels[4];
+    };
+
+    struct FntGlyph
+    {
+        unsigned int    Id;
+        unsigned short  X, Y;
+        unsigned short  Width, Height;
+        signed short    XOffset, YOffset;
+        signed short    XAdvance;
+        unsigned char   Page;
+        unsigned char   Channel;
+    };
+
+    struct FntKerning
+    {
+        unsigned int    IdFirst;
+        unsigned int    IdSecond;
+        signed short    Amount;
+    };
 #pragma pack(pop)
 #pragma pack(pop)
 
 
-	unsigned char*			Data;				// Raw data, content of .fnt file
-	int						DataSize;			//
-	bool					DataOwned;			// 
-	const FntInfo*			Info;				// (point into raw data)
-	const FntCommon*		Common;				// (point into raw data)
-	const FntGlyph*			Glyphs;				// (point into raw data)
-	size_t					GlyphsCount;		//
-	const FntKerning*		Kerning;			// (point into raw data)
-	size_t					KerningCount;		//
-	int						TabCount;			// FIXME: mishandled (add fixed amount instead of aligning to column)
-	ImVector<const char*>	Filenames;			// (point into raw data)
-	ImVector<int>			IndexLookup;		// (built)
-
-	ImBitmapFont();
-	~ImBitmapFont() { Clear(); }
-
-	bool					LoadFromMemory(const void* data, int data_size);
-	bool					LoadFromFile(const char* filename);
-	void					Clear();
-	void					BuildLookupTable();
-	const FntGlyph *		FindGlyph(unsigned short c) const;
-	float					GetFontSize() const	{ return (float)Info->FontSize; }
-
-	ImVec2					CalcTextSize(float size, float max_width, const char* text_begin, const char* text_end, const char** remaining = NULL) const;
-	void					RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices) const;
+    unsigned char*          Data;               // Raw data, content of .fnt file
+    int                     DataSize;           //
+    bool                    DataOwned;          // 
+    const FntInfo*          Info;               // (point into raw data)
+    const FntCommon*        Common;             // (point into raw data)
+    const FntGlyph*         Glyphs;             // (point into raw data)
+    size_t                  GlyphsCount;        //
+    const FntKerning*       Kerning;            // (point into raw data)
+    size_t                  KerningCount;       //
+    int                     TabCount;           // FIXME: mishandled (add fixed amount instead of aligning to column)
+    ImVector<const char*>   Filenames;          // (point into raw data)
+    ImVector<int>           IndexLookup;        // (built)
+
+    ImBitmapFont();
+    ~ImBitmapFont() { Clear(); }
+
+    bool                    LoadFromMemory(const void* data, int data_size);
+    bool                    LoadFromFile(const char* filename);
+    void                    Clear();
+    void                    BuildLookupTable();
+    const FntGlyph *        FindGlyph(unsigned short c) const;
+    float                   GetFontSize() const { return (float)Info->FontSize; }
+
+    ImVec2                  CalcTextSize(float size, float max_width, const char* text_begin, const char* text_end, const char** remaining = NULL) const;
+    void                    RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices) const;
 };
 };

Some files were not shown because too many files changed in this diff