fixed no vsync
This commit is contained in:
parent
13703f1775
commit
4857637532
23 changed files with 1842 additions and 22 deletions
3
deps/vgcore/CMakeLists.txt
vendored
3
deps/vgcore/CMakeLists.txt
vendored
|
|
@ -4,6 +4,9 @@ project(VGCore VERSION 0.1.1)
|
|||
|
||||
set (CMAKE_CXX_STANDARD 20)
|
||||
|
||||
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_MDL_IMPORTER)
|
||||
ADD_DEFINITIONS(-DASSIMP_BUILD_NO_HMP_IMPORTER)
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
find_package(GLEW REQUIRED)
|
||||
find_package(Boost REQUIRED COMPONENTS filesystem)
|
||||
|
|
|
|||
2
deps/vgcore/deps/IconFontCppHeaders
vendored
2
deps/vgcore/deps/IconFontCppHeaders
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 90da8021ec7c7792c454c3f43516595754a91765
|
||||
Subproject commit 1a083cca7d650c0615e32a1d39d56892a2ce8c5b
|
||||
2
deps/vgcore/deps/VMirror/CMakeLists.txt
vendored
2
deps/vgcore/deps/VMirror/CMakeLists.txt
vendored
|
|
@ -4,7 +4,7 @@ project(VMirror)
|
|||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
|
||||
add_library(VMirror SHARED
|
||||
add_library(VMirror STATIC
|
||||
Source/AssemblyRegistry.cpp
|
||||
Source/AssemblyRegistry.h
|
||||
Source/NativeImpl/NativeAssembly.h
|
||||
|
|
|
|||
2
deps/vgcore/deps/VMirror/Source/Assembly.h
vendored
2
deps/vgcore/deps/VMirror/Source/Assembly.h
vendored
|
|
@ -17,7 +17,7 @@
|
|||
#ifdef VMIRROR_SELF_OVERRIDE
|
||||
# define VMIRROR_OVERRIDE true
|
||||
# define VMIRROR_ASSEMBLYNAME "NONE"
|
||||
# warning VMirror self override is enabled THIS IS ONLY FOR USE BY VMIRROR ITSELF
|
||||
# pragma message ( "VMirror self override is enabled THIS IS ONLY FOR USE BY VMIRROR ITSELF" )
|
||||
#endif
|
||||
|
||||
namespace VMirror{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace VMirror{
|
|||
}
|
||||
|
||||
void AssemblyRegistry::selfRegister(AssemblyInfo *info) {
|
||||
std::cout << "Registering assembly :" << info->m_name << std::endl;
|
||||
std::cout << "Registering assembly: " << info->m_name << std::endl;
|
||||
|
||||
if(std::any_of(m_assemblies.begin(), m_assemblies.end(),[&](const std::unique_ptr<Assembly> &assembly){
|
||||
return assembly->m_info->m_name == info->m_name;
|
||||
|
|
|
|||
29
deps/vgcore/deps/VMirror/Source/NativeImpl/Windows/NativeAssembly.h
vendored
Normal file
29
deps/vgcore/deps/VMirror/Source/NativeImpl/Windows/NativeAssembly.h
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Created by tv on 04.09.23.
|
||||
//
|
||||
|
||||
#ifndef SPOONTEXTEDIT_NATIVEASSEMBLY_H
|
||||
#define SPOONTEXTEDIT_NATIVEASSEMBLY_H
|
||||
|
||||
#include "NativeImpl/NativeAssembly.h"
|
||||
#include<windows.h>
|
||||
#include<filesystem>
|
||||
#include<iostream>
|
||||
|
||||
//Stubbed out
|
||||
|
||||
namespace VMirror{
|
||||
NativeAssembly::NativeAssembly(std::string name) {
|
||||
|
||||
}
|
||||
|
||||
void *NativeAssembly::getExport(const std::string &name) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NativeAssembly::~NativeAssembly() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif //SPOONTEXTEDIT_NATIVEASSEMBLY_H
|
||||
|
|
@ -4,10 +4,11 @@
|
|||
|
||||
#ifndef ENGINE_NATIVEASSEMBLYINTERNALS_H
|
||||
#define ENGINE_NATIVEASSEMBLYINTERNALS_H
|
||||
#include <windows.h>
|
||||
|
||||
namespace VMirror{
|
||||
struct NativeAssemblyInternals {
|
||||
|
||||
//HINSTANCE m_assembly;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
2
deps/vgcore/deps/assimp
vendored
2
deps/vgcore/deps/assimp
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 5770faac102bddcc26665dc81cf27c5328c1a6ab
|
||||
Subproject commit 7b6bf139cfc674838d30b8fec5beac0425324d3a
|
||||
2
deps/vgcore/deps/glfw
vendored
2
deps/vgcore/deps/glfw
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 3fa2360720eeba1964df3c0ecf4b5df8648a8e52
|
||||
Subproject commit 3eaf1255b29fdf5c2895856c7be7d7185ef2b241
|
||||
2
deps/vgcore/deps/glm
vendored
2
deps/vgcore/deps/glm
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 5c46b9c07008ae65cb81ab79cd677ecc1934b903
|
||||
Subproject commit 47585fde0c49fa77a2bf2fb1d2ead06999fd4b6e
|
||||
|
|
@ -19,13 +19,9 @@ namespace Graphics {
|
|||
|
||||
void Framebuffer::bind() {
|
||||
glBindFramebuffer(GL_FRAMEBUFFER,m_framebufferId);
|
||||
|
||||
m_shader.use();
|
||||
|
||||
glViewport(0, 0, m_size.x, m_size.y);
|
||||
|
||||
setBuffers();
|
||||
|
||||
}
|
||||
|
||||
void Framebuffer::setBuffers() {
|
||||
|
|
|
|||
2
deps/vgcore/src/virintox/gcore/Graphics.cpp
vendored
2
deps/vgcore/src/virintox/gcore/Graphics.cpp
vendored
|
|
@ -99,6 +99,8 @@ namespace Graphics {
|
|||
info->construct();
|
||||
}
|
||||
|
||||
glfwSwapInterval(1);
|
||||
|
||||
Graphics::BeginLoop();
|
||||
Graphics::Quit();
|
||||
}
|
||||
|
|
|
|||
53
deps/vgcore/src/virintox/gcore/Mesh.cpp
vendored
53
deps/vgcore/src/virintox/gcore/Mesh.cpp
vendored
|
|
@ -10,6 +10,35 @@
|
|||
|
||||
namespace Graphics{
|
||||
|
||||
Mesh::Mesh(const std::vector<glm::vec2> &Points, const std::vector<GLuint> &Indices) {
|
||||
glGenVertexArrays(1, &VAO);
|
||||
glGenBuffers(1, &VBO);
|
||||
glGenBuffers(1, &EBO);
|
||||
|
||||
VCount = Indices.size();
|
||||
|
||||
std::vector<float> VertexData{};
|
||||
for(int x = 0; x < Points.size(); x++){
|
||||
VertexData.push_back(Points[x].x);
|
||||
VertexData.push_back(Points[x].y);
|
||||
}
|
||||
|
||||
glBindVertexArray(VAO);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VBO);
|
||||
glBufferData(GL_ARRAY_BUFFER, VertexData.size() * sizeof(float), VertexData.data(), GL_STATIC_DRAW);
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, Indices.size() * sizeof(int), Indices.data(), GL_STATIC_DRAW);
|
||||
|
||||
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(float), (void*)0);
|
||||
glEnableVertexAttribArray(0);
|
||||
|
||||
glBindVertexArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
}
|
||||
|
||||
//Mesh::Mesh(boost::filesystem::path PathToModel, Shader &ShaderToUse): shader(ShaderToUse){
|
||||
|
||||
//}
|
||||
|
|
@ -21,7 +50,7 @@ namespace Graphics{
|
|||
/* glCullFace(GL_BACK);*/
|
||||
|
||||
VCount = Indices.size();
|
||||
|
||||
|
||||
std::vector<float> VertexData{};
|
||||
for(int x = 0; x < Points.size() || x < TexCoords.size(); x++){
|
||||
VertexData.push_back(Points[x].x);
|
||||
|
|
@ -35,7 +64,7 @@ namespace Graphics{
|
|||
VertexData.push_back(Normals[x].z);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
glBindVertexArray(VAO);
|
||||
|
||||
|
|
@ -138,6 +167,24 @@ namespace Graphics{
|
|||
mat.m_emmissionMap.setActive(3);
|
||||
mat.m_teamcolorMap.setActive(4);
|
||||
|
||||
/* glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_FRONT);*/
|
||||
|
||||
const GLenum buffers[] = {GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2};
|
||||
glDrawBuffers(3, buffers);
|
||||
|
||||
glDrawElements(
|
||||
GL_TRIANGLES, // mode
|
||||
VCount, // count
|
||||
GL_UNSIGNED_INT, // type
|
||||
(void*)0 // element array buffer offset
|
||||
);
|
||||
}
|
||||
|
||||
void Mesh::Draw() const{
|
||||
glBindVertexArray(VAO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO);
|
||||
|
||||
/* glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_FRONT);*/
|
||||
|
||||
|
|
@ -185,4 +232,4 @@ namespace Graphics{
|
|||
glDeleteBuffers(1,&VBO);
|
||||
glDeleteBuffers(1,&EBO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
deps/vgcore/src/virintox/gcore/Mesh.h
vendored
2
deps/vgcore/src/virintox/gcore/Mesh.h
vendored
|
|
@ -19,6 +19,7 @@ namespace Graphics {
|
|||
//explicit Mesh(boost::filesystem::path PathToModel,Shader &ShaderToUse);
|
||||
|
||||
//explicit Mesh(const std::vector<glm::mat3x2> &Polygons, const std::vector<glm::mat3x2> &TexCoords,const std::vector<glm::vec3> &Normals, Shader &Shader = GetDefaultShader2D());
|
||||
Mesh(const std::vector<glm::vec2> &Points, const std::vector<GLuint> &Indices);
|
||||
Mesh(const std::vector<glm::vec2> &Points, const std::vector<GLuint> &Indices,
|
||||
const std::vector<glm::vec2> &TexCoords, const std::vector<glm::vec3> &Normals);
|
||||
|
||||
|
|
@ -34,6 +35,7 @@ namespace Graphics {
|
|||
Mesh(Mesh&&) = default;
|
||||
|
||||
void Draw(const Graphics::Material &mat) const;
|
||||
void Draw() const;
|
||||
|
||||
~Mesh();
|
||||
private:
|
||||
|
|
|
|||
2
deps/vgcore/src/virintox/gcore/Texture.cpp
vendored
2
deps/vgcore/src/virintox/gcore/Texture.cpp
vendored
|
|
@ -104,4 +104,4 @@ namespace Graphics {
|
|||
Texture::~Texture() {
|
||||
glDeleteTextures(1, &m_texId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "IconsFontAwesome6.h"
|
||||
#include "FileSelectDialog.h"
|
||||
#include<misc/cpp/imgui_stdlib.h>
|
||||
#include"MessageBox.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
|
|
@ -71,7 +72,7 @@ namespace Graphics {
|
|||
OnOpenFunc,
|
||||
[](boost::filesystem::path p) {
|
||||
Graphics::window->msgBoxes.push_back(
|
||||
new MessageBox(
|
||||
new Graphics::MessageBox(
|
||||
"Saving should not be enabled for this File Selector!!!",
|
||||
Warning));
|
||||
}) {}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
#pragma once
|
||||
#include "Widget.h"
|
||||
#include <exception>
|
||||
|
||||
#ifdef WIN32
|
||||
#undef MessageBox
|
||||
#endif
|
||||
namespace Graphics{
|
||||
|
||||
enum ErrorSeverity{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
namespace Graphics{
|
||||
class ViewportWidget : public Graphics::Widget{
|
||||
public:
|
||||
VABSTRACTCLASS(ViewportWidget,ESC({&Widget::classInfo}))
|
||||
VABSTRACTCLASS(ViewportWidget,ESC({&Widget::classInfo, nullptr}))
|
||||
ViewportWidget(std::string name,bool active);
|
||||
void PreDraw() override;
|
||||
void PostDraw() override;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ namespace Graphics {
|
|||
ImGui::OpenPopup("Are you sure?##QuitModal");
|
||||
}
|
||||
|
||||
glfwSwapInterval(0);
|
||||
DrawBG();
|
||||
|
||||
ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(),ImGuiDockNodeFlags_PassthruCentralNode);
|
||||
|
|
|
|||
6
deps/vgcore/src/virintox/gcore/gui/Window.h
vendored
6
deps/vgcore/src/virintox/gcore/gui/Window.h
vendored
|
|
@ -116,9 +116,9 @@ namespace Graphics{
|
|||
class MenuName##SortSetter: public Graphics::MenuSortSetter{ \
|
||||
VCLASS(MenuName##SortSetteer, ESC({&Graphics::MenuSortSetter::classInfo,nullptr}))\
|
||||
MenuName##SortSetter(): Graphics::MenuSortSetter(#MenuName,id){ \
|
||||
delete this; \
|
||||
} \
|
||||
}; \
|
||||
delete this; \
|
||||
} \
|
||||
}; \
|
||||
REGISTERVCLASS(MenuName##SortSetter)
|
||||
|
||||
}
|
||||
|
|
|
|||
1724
deps/vgcore/src/virintox/gcore/stb_image_write.h
vendored
Normal file
1724
deps/vgcore/src/virintox/gcore/stb_image_write.h
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue