mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Fixed for OSX.
This commit is contained in:
@@ -13,11 +13,11 @@ Frame::Frame(Type type) : Node(), type_(type), side_(nullptr), top_(nullptr), sh
|
|||||||
color = glm::vec4( 1.f, 1.f, 1.f, 1.f);
|
color = glm::vec4( 1.f, 1.f, 1.f, 1.f);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SHARP_LARGE:
|
case SHARP_LARGE:
|
||||||
square_ = new LineSquare(color, 2.f );
|
square_ = new LineSquare(color, 3 );
|
||||||
shadow_ = new Mesh("mesh/shadow.ply", "images/shadow.png");
|
shadow_ = new Mesh("mesh/shadow.ply", "images/shadow.png");
|
||||||
break;
|
break;
|
||||||
case SHARP_THIN:
|
case SHARP_THIN:
|
||||||
square_ = new LineSquare(color, 2.f );
|
square_ = new LineSquare(color, 3 );
|
||||||
break;
|
break;
|
||||||
case ROUND_LARGE:
|
case ROUND_LARGE:
|
||||||
side_ = new Mesh("mesh/border_large_round.ply");
|
side_ = new Mesh("mesh/border_large_round.ply");
|
||||||
|
|||||||
@@ -250,11 +250,19 @@ void LineStrip::draw(glm::mat4 modelview, glm::mat4 projection)
|
|||||||
if ( !initialized() )
|
if ( !initialized() )
|
||||||
init();
|
init();
|
||||||
|
|
||||||
glLineWidth(linewidth_ * Rendering::manager().mainWindow().dpiScale());
|
// glLineWidth(linewidth_ * 2.f * Rendering::manager().mainWindow().dpiScale());
|
||||||
|
|
||||||
Primitive::draw(modelview, projection);
|
glm::mat4 mv = modelview;
|
||||||
|
glm::mat4 scale = glm::scale(glm::identity<glm::mat4>(), glm::vec3(1.001f, 1.001f, 1.f));
|
||||||
|
|
||||||
glLineWidth(1);
|
for (uint i = 0 ; i < linewidth_ ; ++i ) {
|
||||||
|
Primitive::draw(mv, projection);
|
||||||
|
mv *= scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// glLineWidth(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LineStrip::accept(Visitor& v)
|
void LineStrip::accept(Visitor& v)
|
||||||
|
|||||||
@@ -176,13 +176,20 @@ bool Rendering::init()
|
|||||||
glfwSetKeyCallback( output_.window(), WindowEscapeFullscreen);
|
glfwSetKeyCallback( output_.window(), WindowEscapeFullscreen);
|
||||||
glfwSetMouseButtonCallback( output_.window(), WindowToggleFullscreen);
|
glfwSetMouseButtonCallback( output_.window(), WindowToggleFullscreen);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Rendering::show()
|
||||||
|
{
|
||||||
// show output window
|
// show output window
|
||||||
output_.show();
|
output_.show();
|
||||||
|
|
||||||
// show main window
|
// show main window
|
||||||
main_.show();
|
main_.show();
|
||||||
|
|
||||||
return true;
|
// show menu on first show
|
||||||
|
UserInterface::manager().showPannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Rendering::isActive()
|
bool Rendering::isActive()
|
||||||
@@ -520,7 +527,8 @@ bool RenderingWindow::init(int id, GLFWwindow *share)
|
|||||||
// set position
|
// set position
|
||||||
glfwSetWindowPos(window_, winset.x, winset.y);
|
glfwSetWindowPos(window_, winset.x, winset.y);
|
||||||
// window position and resize callbacks
|
// window position and resize callbacks
|
||||||
glfwSetFramebufferSizeCallback( window_, WindowResizeCallback );
|
glfwSetWindowSizeCallback( window_, WindowResizeCallback );
|
||||||
|
// glfwSetFramebufferSizeCallback( window_, WindowResizeCallback );
|
||||||
glfwSetWindowPosCallback( window_, WindowMoveCallback );
|
glfwSetWindowPosCallback( window_, WindowMoveCallback );
|
||||||
|
|
||||||
// take opengl context ownership
|
// take opengl context ownership
|
||||||
@@ -577,12 +585,13 @@ bool RenderingWindow::init(int id, GLFWwindow *share)
|
|||||||
|
|
||||||
void RenderingWindow::show()
|
void RenderingWindow::show()
|
||||||
{
|
{
|
||||||
|
glfwShowWindow(window_);
|
||||||
|
|
||||||
if ( Settings::application.windows[id_].fullscreen ) {
|
if ( Settings::application.windows[id_].fullscreen ) {
|
||||||
GLFWmonitor *mo = monitorNamed(Settings::application.windows[id_].monitor);
|
GLFWmonitor *mo = monitorNamed(Settings::application.windows[id_].monitor);
|
||||||
setFullscreen(mo);
|
setFullscreen(mo);
|
||||||
}
|
}
|
||||||
|
|
||||||
glfwShowWindow(window_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// custom surface with a new VAO
|
// custom surface with a new VAO
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ public:
|
|||||||
|
|
||||||
// Initialization OpenGL and GLFW window creation
|
// Initialization OpenGL and GLFW window creation
|
||||||
bool init();
|
bool init();
|
||||||
|
|
||||||
|
void show();
|
||||||
|
|
||||||
// true if active rendering window
|
// true if active rendering window
|
||||||
bool isActive();
|
bool isActive();
|
||||||
// draw one frame
|
// draw one frame
|
||||||
|
|||||||
@@ -19,13 +19,15 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
static int global_index_ = 0;
|
||||||
|
|
||||||
// Node
|
// Node
|
||||||
Node::Node() : initialized_(false), visible_(true), refcount_(0)
|
Node::Node() : initialized_(false), visible_(true), refcount_(0)
|
||||||
{
|
{
|
||||||
// create unique id
|
// create unique id
|
||||||
auto duration = std::chrono::system_clock::now().time_since_epoch();
|
// auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
|
||||||
id_ = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count() % 100000000;
|
// id_ = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count() % 100000000;
|
||||||
|
id_ = global_index_ < INT_MAX ? global_index_++ : 0;
|
||||||
|
|
||||||
transform_ = glm::identity<glm::mat4>();
|
transform_ = glm::identity<glm::mat4>();
|
||||||
scale_ = glm::vec3(1.f);
|
scale_ = glm::vec3(1.f);
|
||||||
|
|||||||
@@ -4,7 +4,10 @@
|
|||||||
|
|
||||||
SearchVisitor::SearchVisitor(Node *node) : Visitor(), node_(node), id_(0), found_(false)
|
SearchVisitor::SearchVisitor(Node *node) : Visitor(), node_(node), id_(0), found_(false)
|
||||||
{
|
{
|
||||||
id_ = node->id();
|
if (node != nullptr)
|
||||||
|
id_ = node->id();
|
||||||
|
else
|
||||||
|
id_ = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchVisitor::SearchVisitor(int id) : Visitor(), node_(nullptr), id_(id), found_(false)
|
SearchVisitor::SearchVisitor(int id) : Visitor(), node_(nullptr), id_(id), found_(false)
|
||||||
|
|||||||
@@ -224,6 +224,9 @@ FrameBuffer *Source::frame() const
|
|||||||
|
|
||||||
bool Source::contains(Node *node) const
|
bool Source::contains(Node *node) const
|
||||||
{
|
{
|
||||||
|
if ( node == nullptr )
|
||||||
|
return false;
|
||||||
|
|
||||||
hasNode tester(node);
|
hasNode tester(node);
|
||||||
return tester(this);
|
return tester(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -901,10 +901,13 @@ void UserInterface::RenderShaderEditor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void UserInterface::showPannel()
|
void UserInterface::showPannel()
|
||||||
{
|
{
|
||||||
navigator.showPannelSource(Mixer::manager().indexCurrentSource());
|
int s = Mixer::manager().indexCurrentSource();
|
||||||
|
if (s > -1)
|
||||||
|
navigator.showPannelSource(s);
|
||||||
|
else
|
||||||
|
navigator.togglePannelMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
Navigator::Navigator()
|
Navigator::Navigator()
|
||||||
|
|||||||
1
View.cpp
1
View.cpp
@@ -106,6 +106,7 @@ MixingView::MixingView() : View(MIXING)
|
|||||||
// no settings found: store application default
|
// no settings found: store application default
|
||||||
Settings::application.views[mode_].name = "Mixing";
|
Settings::application.views[mode_].name = "Mixing";
|
||||||
scene.root()->scale_ = glm::vec3(2.4f, 2.4f, 1.0f);
|
scene.root()->scale_ = glm::vec3(2.4f, 2.4f, 1.0f);
|
||||||
|
scene.root()->translation_ = glm::vec3(1.0f, 0.0f, 0.0f);
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user