тест гуи
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#include "imgui.h"
|
||||
#include "imgui_impl_glfw.h"
|
||||
#include "imgui_impl_opengl3.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "GUI/visual.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
if(!glfwInit()) return 1;
|
||||
const char* glsl_version = "#version 130";
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR,3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR,0);
|
||||
|
||||
GLFWwindow* window = glfwCreateWindow(1280,720,"Test AI Visualizer", NULL,NULL);
|
||||
if(window == NULL) return 1;
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
ImGui::StyleColorsDark();
|
||||
ImGui_ImplGlfw_InitForOpenGL(window,true);
|
||||
ImGui_ImplOpenGL3_Init(glsl_version);
|
||||
MyVisualizer vis;
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
glfwPollEvents();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
ImGui::NewFrame();
|
||||
vis.Render();
|
||||
ImGui::Render();
|
||||
int display_w, display_h;
|
||||
|
||||
glfwGetFramebufferSize(window,&display_w,&display_h);
|
||||
glViewport(0,0,display_w,display_h);
|
||||
glClearColor(0.45f,0.55f,0.60f,1.00f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
glfwSwapBuffers(window);
|
||||
}
|
||||
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
ImGui::DestroyContext();
|
||||
glfwDestroyWindow(window);
|
||||
glfwTerminate();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user