update
This commit is contained in:
3
.clangd
3
.clangd
@@ -1,3 +1,6 @@
|
|||||||
|
If:
|
||||||
|
OS: Windows
|
||||||
|
|
||||||
CompileFlags:
|
CompileFlags:
|
||||||
Add:
|
Add:
|
||||||
--target=x86_64-w64-mingw32
|
--target=x86_64-w64-mingw32
|
||||||
38
main.cpp
38
main.cpp
@@ -1,6 +1,7 @@
|
|||||||
#include "lopenglprogram.h"
|
#include "lopenglprogram.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <glm/ext/matrix_clip_space.hpp>
|
#include <glm/ext/matrix_clip_space.hpp>
|
||||||
#include <glm/ext/matrix_transform.hpp>
|
#include <glm/ext/matrix_transform.hpp>
|
||||||
@@ -10,9 +11,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <vector>
|
||||||
#include <print>
|
|
||||||
|
|
||||||
|
|
||||||
class GLWidget {
|
class GLWidget {
|
||||||
|
|
||||||
@@ -55,6 +54,9 @@ public:
|
|||||||
if (heatmapVbo_) {
|
if (heatmapVbo_) {
|
||||||
glDeleteBuffers(1, &heatmapVbo_);
|
glDeleteBuffers(1, &heatmapVbo_);
|
||||||
}
|
}
|
||||||
|
if (heatmapIbo_) {
|
||||||
|
glDeleteBuffers(1, &heatmapIbo_);
|
||||||
|
}
|
||||||
deinit_ = true;
|
deinit_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,6 +226,29 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void initHeatmapGeometry_() {
|
void initHeatmapGeometry_() {
|
||||||
|
if (heatmapIbo_) {
|
||||||
|
glDeleteBuffers(1, &heatmapIbo_);
|
||||||
|
heatmapIbo_ = 0;
|
||||||
|
}
|
||||||
|
if (heatmapVbo_) {
|
||||||
|
glDeleteBuffers(1, &heatmapVbo_);
|
||||||
|
heatmapVbo_ = 0;
|
||||||
|
}
|
||||||
|
if (heatmapVao_) {
|
||||||
|
glDeleteVertexArrays(1, &heatmapVao_);
|
||||||
|
heatmapVao_ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const float aspect = (panelWidth_ > 1e-6F) ? (panelHeight_ / panelWidth_) : 1.0F;
|
||||||
|
const int max_res = 512;
|
||||||
|
const int cols = std::max(2, std::min(dotcols_ * dotupscale_, max_res));
|
||||||
|
int rows = std::max(2, int(cols * aspect + 0.5F));
|
||||||
|
rows = std::max(2, std::min(rows, max_res));
|
||||||
|
heatmapcols_ = cols;
|
||||||
|
heatmaprows_ = rows;
|
||||||
|
|
||||||
|
const int vertex_count = cols * rows;
|
||||||
|
std::vector<float> verts;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,6 +508,7 @@ private:
|
|||||||
std::string heatmapFragShaderPath_;
|
std::string heatmapFragShaderPath_;
|
||||||
unsigned int heatmapVao_ = 0;
|
unsigned int heatmapVao_ = 0;
|
||||||
unsigned int heatmapVbo_ = 0;
|
unsigned int heatmapVbo_ = 0;
|
||||||
|
unsigned int heatmapIbo_ = 0;
|
||||||
|
|
||||||
ViewPort viewport_{800, 600};
|
ViewPort viewport_{800, 600};
|
||||||
Camera camera_{glm::vec3(0.0F, 0.0F, 2.0F)};
|
Camera camera_{glm::vec3(0.0F, 0.0F, 2.0F)};
|
||||||
@@ -493,6 +519,12 @@ private:
|
|||||||
float lastFrame_ = 0.0f;
|
float lastFrame_ = 0.0f;
|
||||||
bool lightMode_ = false;
|
bool lightMode_ = false;
|
||||||
|
|
||||||
|
int dotcols_ = 8;
|
||||||
|
int dotrows_ = 12;
|
||||||
|
int dotupscale_ = 100;
|
||||||
|
int heatmapcols_;
|
||||||
|
int heatmaprows_;
|
||||||
|
|
||||||
bool deinit_;
|
bool deinit_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user