16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 00:49:19 +02:00

pbo changes, trainingcard remarks

This commit is contained in:
milek7
2019-03-31 14:02:43 +02:00
parent a8a0cbb9b3
commit 891fe7ddee
6 changed files with 23 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ namespace gl
UNIFORM_BUFFER UNIFORM_BUFFER
}; };
private: protected:
static GLenum glenum_target(targets target); static GLenum glenum_target(targets target);
public: public:

View File

@@ -1,3 +1,5 @@
#pragma once
#include "object.h" #include "object.h"
namespace gl namespace gl

View File

@@ -49,3 +49,16 @@ bool gl::pbo::is_busy()
return true; return true;
} }
void* gl::pbo::map(GLuint mode, targets target)
{
bind(target);
return glMapBuffer(buffer::glenum_target(target), mode);
}
void gl::pbo::unmap(targets target)
{
bind(target);
glUnmapBuffer(buffer::glenum_target(target));
sync.emplace();
}

View File

@@ -1,9 +1,11 @@
#pragma once
#include "buffer.h" #include "buffer.h"
#include "fence.h" #include "fence.h"
#include <optional> #include <optional>
namespace gl { namespace gl {
class pbo : private buffer class pbo : public buffer
{ {
std::optional<fence> sync; std::optional<fence> sync;
int size = 0; int size = 0;
@@ -13,5 +15,8 @@ namespace gl {
void request_read(int x, int y, int lx, int ly, int pixsize = 4, GLenum format = GL_RGBA, GLenum type = GL_UNSIGNED_BYTE); void request_read(int x, int y, int lx, int ly, int pixsize = 4, GLenum format = GL_RGBA, GLenum type = GL_UNSIGNED_BYTE);
bool read_data(int lx, int ly, void *data, int pixsize = 4); bool read_data(int lx, int ly, void *data, int pixsize = 4);
bool is_busy(); bool is_busy();
void* map(GLuint mode, targets target = PIXEL_UNPACK_BUFFER);
void unmap(targets target = PIXEL_UNPACK_BUFFER);
}; };
} }

View File

@@ -59,8 +59,6 @@ void trainingcard_panel::render_contents()
ImGui::TextUnformatted(u8"Proszę czekać, trwa archiwizacja nagrania..."); ImGui::TextUnformatted(u8"Proszę czekać, trwa archiwizacja nagrania...");
ImGui::EndPopup(); ImGui::EndPopup();
return;
} }
if (start_time_wall) { if (start_time_wall) {
@@ -82,10 +80,8 @@ void trainingcard_panel::render_contents()
ImGui::SameLine(); ImGui::SameLine();
ImGui::InputText("##instructor", &instructor_name[0], instructor_name.size()); ImGui::InputText("##instructor", &instructor_name[0], instructor_name.size());
/*
ImGui::TextUnformatted("Uwagi"); ImGui::TextUnformatted("Uwagi");
ImGui::InputTextMultiline("##remarks", &remarks[0], remarks.size(), ImVec2(-1.0f, 200.0f)); ImGui::InputTextMultiline("##remarks", &remarks[0], remarks.size(), ImVec2(-1.0f, 200.0f));
*/
if (!start_time_wall) { if (!start_time_wall) {
if (ImGui::Button("Rozpocznij szkolenie")) { if (ImGui::Button("Rozpocznij szkolenie")) {

View File

@@ -19,7 +19,7 @@ class trainingcard_panel : public ui_panel
return 1; return 1;
} }
virtual int EndRecording( std::string training_identifier ) { virtual int EndRecording( std::string training_identifier ) {
std::this_thread::sleep_for(std::chrono::duration<float>(5.0f)); std::this_thread::sleep_for(std::chrono::duration<float>(1.0f));
return 1; return 1;
} }