-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP ImGui and DrawRequest/DrawCallHandler
- Loading branch information
Showing
223 changed files
with
107,092 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "DrawCallHandler.hpp" | ||
|
||
namespace Future { | ||
unsigned int DrawCallHandler::Push(DrawRequest request) { | ||
drawRequestQueue.push_back(request); | ||
} | ||
|
||
bool DrawCallHandler::Pop(unsigned int id) { | ||
auto it = std::find_if(drawRequestQueue.begin(), drawRequestQueue.end(), | ||
[id](const DrawRequest& request) { | ||
return request.ID == id; | ||
}); | ||
if (it != drawRequestQueue.end()) { | ||
drawRequestQueue.erase(it); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
void DrawCallHandler::DrawFrame() { | ||
for (unsigned int i = 0; i < drawRequestQueue.size(); i++) | ||
{ | ||
//drawRequestQueue[i].mesh.Draw(shader, camera, matricesMeshes[i], translationsMeshes[i], rotationsMeshes[i], scalesMeshes[i]); | ||
} | ||
drawRequestQueue.clear(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
#include "DrawRequest.hpp" | ||
#include <glad.h> | ||
|
||
namespace Future { | ||
class DrawCallHandler { | ||
public: | ||
[[nodiscard]] unsigned int GetDrawCalls() const { return drawRequestQueue.size(); } | ||
unsigned int Push(DrawRequest request); | ||
bool Pop(unsigned int ID); | ||
void DrawFrame(); | ||
|
||
private: | ||
std::vector<DrawRequest> drawRequestQueue; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
#include "../Shaders.hpp" | ||
#include "../Mesh/Mesh.hpp" | ||
|
||
struct DrawRequest | ||
{ | ||
unsigned int ID; | ||
Future::Shaders shaders; | ||
//Future::Material material; | ||
Future::Mesh mesh; | ||
glm::mat4 modelMatrix; | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule glfw
deleted from
b35641
Submodule imgui
deleted from
fb4104
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# See http://editorconfig.org to read about the EditorConfig format. | ||
# - In theory automatically supported by VS2017+ and most common IDE or text editors. | ||
# - In practice VS2019-VS2022 stills don't trim trailing whitespaces correctly :( | ||
# - Suggest installing this to trim whitespaces: | ||
# GitHub https://github.com/madskristensen/TrailingWhitespace | ||
# VS2019 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer | ||
# VS2022 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespace64 | ||
# (in spite of its name doesn't only visualize but also trims) | ||
# - Alternative for older VS2010 to VS2015: https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Default settings: | ||
# Use 4 spaces as indentation | ||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[imstb_*] | ||
indent_size = 3 | ||
trim_trailing_whitespace = false | ||
|
||
[Makefile] | ||
indent_style = tab | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
* text=auto | ||
|
||
*.c text | ||
*.cpp text | ||
*.h text | ||
*.m text | ||
*.mm text | ||
*.md text | ||
*.txt text | ||
*.html text | ||
*.bat text | ||
*.frag text | ||
*.vert text | ||
*.mkb text | ||
*.icf text | ||
|
||
*.sln text eol=crlf | ||
*.vcxproj text eol=crlf | ||
*.vcxproj.filters text eol=crlf | ||
*.natvis text eol=crlf | ||
|
||
Makefile text eol=lf | ||
*.sh text eol=lf | ||
*.pbxproj text eol=lf | ||
*.storyboard text eol=lf | ||
*.plist text eol=lf | ||
|
||
*.png binary | ||
*.ttf binary | ||
*.lib binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
## OSX artifacts | ||
.DS_Store | ||
|
||
## Dear ImGui artifacts | ||
imgui.ini | ||
imgui*.ini | ||
|
||
## General build artifacts | ||
*.o | ||
*.obj | ||
*.exe | ||
examples/*/Debug/* | ||
examples/*/Release/* | ||
examples/*/x64/* | ||
|
||
## Visual Studio artifacts | ||
.vs | ||
ipch | ||
*.opensdf | ||
*.log | ||
*.pdb | ||
*.ilk | ||
*.user | ||
*.sdf | ||
*.suo | ||
*.VC.db | ||
*.VC.VC.opendb | ||
|
||
## Getting files created in JSON/Schemas/Catalog/ from a VS2022 update | ||
JSON/ | ||
|
||
## Commonly used CMake directories | ||
build*/ | ||
|
||
## Xcode artifacts | ||
project.xcworkspace | ||
xcuserdata | ||
|
||
## Emscripten artifacts | ||
examples/*.o.tmp | ||
examples/*.out.js | ||
examples/*.out.wasm | ||
examples/example_glfw_opengl3/web/* | ||
examples/example_glfw_wgpu/web/* | ||
examples/example_glfw_wgpu/external/* | ||
examples/example_sdl2_opengl3/web/* | ||
|
||
## JetBrains IDE artifacts | ||
.idea | ||
cmake-build-* | ||
|
||
## Unix executables from our example Makefiles | ||
examples/example_glfw_metal/example_glfw_metal | ||
examples/example_glfw_opengl2/example_glfw_opengl2 | ||
examples/example_glfw_opengl3/example_glfw_opengl3 | ||
examples/example_glut_opengl2/example_glut_opengl2 | ||
examples/example_null/example_null | ||
examples/example_sdl2_metal/example_sdl2_metal | ||
examples/example_sdl2_opengl2/example_sdl2_opengl2 | ||
examples/example_sdl2_opengl3/example_sdl2_opengl3 | ||
examples/example_sdl2_sdlrenderer/example_sdl2_sdlrenderer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set(_target "imgui") | ||
|
||
add_library(${_target} | ||
imconfig.h | ||
imgui_demo.cpp | ||
imgui_draw.cpp | ||
imgui_tables.cpp | ||
imgui_widgets.cpp | ||
imgui.cpp | ||
misc/cpp/imgui_stdlib.cpp | ||
misc/cpp/imgui_stdlib.h | ||
backends/imgui_impl_opengl3.cpp | ||
backends/imgui_impl_opengl3.h | ||
backends/imgui_impl_sdl2.cpp | ||
backends/imgui_impl_sdl2.h | ||
) | ||
|
||
target_include_directories(${_target} | ||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/imgui" | ||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}" | ||
) | ||
|
||
target_link_libraries(${_target} PUBLIC SDL2::SDL2main) | ||
target_link_libraries(${_target} PUBLIC SDL2::SDL2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2024 Omar Cornut | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.