mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-26 13:37:00 +00:00
Examples: comment on setting the RenderDrawListsFn function.
This commit is contained in:
parent
dafad3903e
commit
7d6ddbe5c8
@ -29,7 +29,7 @@ struct ImDrawVertAllegro
|
|||||||
ALLEGRO_COLOR col;
|
ALLEGRO_COLOR col;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void ImGui_ImplA5_RenderDrawLists(ImDrawData* draw_data)
|
void ImGui_ImplA5_RenderDrawLists(ImDrawData* draw_data)
|
||||||
{
|
{
|
||||||
int op, src, dst;
|
int op, src, dst;
|
||||||
al_get_blender(&op, &src, &dst);
|
al_get_blender(&op, &src, &dst);
|
||||||
@ -186,7 +186,7 @@ bool ImGui_ImplA5_Init(ALLEGRO_DISPLAY* display)
|
|||||||
io.KeyMap[ImGuiKey_Y] = ALLEGRO_KEY_Y;
|
io.KeyMap[ImGuiKey_Y] = ALLEGRO_KEY_Y;
|
||||||
io.KeyMap[ImGuiKey_Z] = ALLEGRO_KEY_Z;
|
io.KeyMap[ImGuiKey_Z] = ALLEGRO_KEY_Z;
|
||||||
|
|
||||||
io.RenderDrawListsFn = ImGui_ImplA5_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplA5_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
io.ImeWindowHandle = al_get_win_window_handle(g_Display);
|
io.ImeWindowHandle = al_get_win_window_handle(g_Display);
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,7 +39,7 @@ struct VERTEX_CONSTANT_BUFFER
|
|||||||
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
||||||
// If text or lines are blurry when integrating ImGui in your engine:
|
// If text or lines are blurry when integrating ImGui in your engine:
|
||||||
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
||||||
static void ImGui_ImplDX11_RenderDrawLists(ImDrawData* draw_data)
|
void ImGui_ImplDX11_RenderDrawLists(ImDrawData* draw_data)
|
||||||
{
|
{
|
||||||
// Create and grow vertex/index buffers if needed
|
// Create and grow vertex/index buffers if needed
|
||||||
if (!g_pVB || g_VertexBufferSize < draw_data->TotalVtxCount)
|
if (!g_pVB || g_VertexBufferSize < draw_data->TotalVtxCount)
|
||||||
@ -457,7 +457,7 @@ bool ImGui_ImplDX11_Init(void* hwnd, ID3D11Device* device, ID3D11DeviceContex
|
|||||||
io.KeyMap[ImGuiKey_Y] = 'Y';
|
io.KeyMap[ImGuiKey_Y] = 'Y';
|
||||||
io.KeyMap[ImGuiKey_Z] = 'Z';
|
io.KeyMap[ImGuiKey_Z] = 'Z';
|
||||||
|
|
||||||
io.RenderDrawListsFn = ImGui_ImplDX11_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplDX11_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
|
||||||
io.ImeWindowHandle = g_hWnd;
|
io.ImeWindowHandle = g_hWnd;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -30,7 +30,7 @@ struct CUSTOMVERTEX
|
|||||||
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
||||||
// If text or lines are blurry when integrating ImGui in your engine:
|
// If text or lines are blurry when integrating ImGui in your engine:
|
||||||
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
||||||
static void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
|
void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data)
|
||||||
{
|
{
|
||||||
// Create and grow buffers if needed
|
// Create and grow buffers if needed
|
||||||
if (!g_pVB || g_VertexBufferSize < draw_data->TotalVtxCount)
|
if (!g_pVB || g_VertexBufferSize < draw_data->TotalVtxCount)
|
||||||
@ -211,7 +211,7 @@ bool ImGui_ImplDX9_Init(void* hwnd, IDirect3DDevice9* device)
|
|||||||
io.KeyMap[ImGuiKey_Y] = 'Y';
|
io.KeyMap[ImGuiKey_Y] = 'Y';
|
||||||
io.KeyMap[ImGuiKey_Z] = 'Z';
|
io.KeyMap[ImGuiKey_Z] = 'Z';
|
||||||
|
|
||||||
io.RenderDrawListsFn = ImGui_ImplDX9_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplDX9_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
|
||||||
io.ImeWindowHandle = g_hWnd;
|
io.ImeWindowHandle = g_hWnd;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -28,7 +28,7 @@ static unsigned int g_VboHandle = 0, g_VaoHandle = 0, g_ElementsHandle = 0;
|
|||||||
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
||||||
// If text or lines are blurry when integrating ImGui in your engine:
|
// If text or lines are blurry when integrating ImGui in your engine:
|
||||||
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
||||||
static void ImGui_ImplGlfwGL3_RenderDrawLists(ImDrawData* draw_data)
|
void ImGui_ImplGlfwGL3_RenderDrawLists(ImDrawData* draw_data)
|
||||||
{
|
{
|
||||||
// Backup GL state
|
// Backup GL state
|
||||||
GLint last_program, last_texture, last_array_buffer, last_element_array_buffer, last_vertex_array;
|
GLint last_program, last_texture, last_array_buffer, last_element_array_buffer, last_vertex_array;
|
||||||
@ -267,7 +267,7 @@ bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks)
|
|||||||
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
|
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
|
||||||
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
|
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
|
||||||
|
|
||||||
io.RenderDrawListsFn = ImGui_ImplGlfwGL3_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplGlfwGL3_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
|
||||||
io.SetClipboardTextFn = ImGui_ImplGlfwGL3_SetClipboardText;
|
io.SetClipboardTextFn = ImGui_ImplGlfwGL3_SetClipboardText;
|
||||||
io.GetClipboardTextFn = ImGui_ImplGlfwGL3_GetClipboardText;
|
io.GetClipboardTextFn = ImGui_ImplGlfwGL3_GetClipboardText;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -23,7 +23,7 @@ static GLuint g_FontTexture = 0;
|
|||||||
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
||||||
// If text or lines are blurry when integrating ImGui in your engine:
|
// If text or lines are blurry when integrating ImGui in your engine:
|
||||||
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
||||||
static void ImGui_ImplGlfw_RenderDrawLists(ImDrawData* draw_data)
|
void ImGui_ImplGlfw_RenderDrawLists(ImDrawData* draw_data)
|
||||||
{
|
{
|
||||||
// We are using the OpenGL fixed pipeline to make the example code simpler to read!
|
// We are using the OpenGL fixed pipeline to make the example code simpler to read!
|
||||||
// A probable faster way to render would be to collate all vertices from all cmd_lists into a single vertex buffer.
|
// A probable faster way to render would be to collate all vertices from all cmd_lists into a single vertex buffer.
|
||||||
@ -203,7 +203,7 @@ bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks)
|
|||||||
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
|
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
|
||||||
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
|
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
|
||||||
|
|
||||||
io.RenderDrawListsFn = ImGui_ImplGlfw_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplGlfw_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
|
||||||
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
|
io.SetClipboardTextFn = ImGui_ImplGlfw_SetClipboardText;
|
||||||
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
|
io.GetClipboardTextFn = ImGui_ImplGlfw_GetClipboardText;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -16,7 +16,7 @@ static GLuint g_FontTexture = 0;
|
|||||||
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
|
||||||
// If text or lines are blurry when integrating ImGui in your engine:
|
// If text or lines are blurry when integrating ImGui in your engine:
|
||||||
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
|
||||||
static void ImGui_ImplSdl_RenderDrawLists(ImDrawData* draw_data)
|
void ImGui_ImplSdl_RenderDrawLists(ImDrawData* draw_data)
|
||||||
{
|
{
|
||||||
// We are using the OpenGL fixed pipeline to make the example code simpler to read!
|
// We are using the OpenGL fixed pipeline to make the example code simpler to read!
|
||||||
// A probable faster way to render would be to collate all vertices from all cmd_lists into a single vertex buffer.
|
// A probable faster way to render would be to collate all vertices from all cmd_lists into a single vertex buffer.
|
||||||
@ -194,7 +194,7 @@ bool ImGui_ImplSdl_Init(SDL_Window *window)
|
|||||||
io.KeyMap[ImGuiKey_Y] = SDLK_y;
|
io.KeyMap[ImGuiKey_Y] = SDLK_y;
|
||||||
io.KeyMap[ImGuiKey_Z] = SDLK_z;
|
io.KeyMap[ImGuiKey_Z] = SDLK_z;
|
||||||
|
|
||||||
io.RenderDrawListsFn = ImGui_ImplSdl_RenderDrawLists;
|
io.RenderDrawListsFn = ImGui_ImplSdl_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
|
||||||
io.SetClipboardTextFn = ImGui_ImplSdl_SetClipboardText;
|
io.SetClipboardTextFn = ImGui_ImplSdl_SetClipboardText;
|
||||||
io.GetClipboardTextFn = ImGui_ImplSdl_GetClipboardText;
|
io.GetClipboardTextFn = ImGui_ImplSdl_GetClipboardText;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user