fixed gles bugs

This commit is contained in:
itsmattkc
2018-11-16 09:45:18 +11:00
parent b264680159
commit 55e1ea4fe9
5 changed files with 19 additions and 15 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
#version 120
uniform sampler2D tex0;
varying vec4 vTexCoord;
varying vec2 vTexCoord;
const float PI = 3.1415926535;
uniform vec2 resolution;
@@ -19,7 +20,7 @@ vec2 distort(vec2 p, vec2 offset) {
void main(void) {
vec2 offset = vec2(xoff/resolution.x, yoff/resolution.y);
vec2 xy = 2.0 * vTexCoord.xy - 1.0 - offset;
vec2 xy = 2.0 * vTexCoord - 1.0 - offset;
vec2 uv;
float d = length(xy);
uv = distort(xy, offset);
+3 -3
View File
@@ -1,6 +1,6 @@
#version 120
uniform sampler2D tex0;
varying vec4 vTexCoord;
varying vec2 vTexCoord;
#define M_PI 3.1415926535897932384626433832795
uniform float size;
@@ -9,7 +9,7 @@ void main(void) {
float maxFactor = 2.0 - (size * 0.01);
vec2 uv;
vec2 xy = 2.0 * vTexCoord.xy - 1.0;
vec2 xy = 2.0 * vTexCoord - 1.0;
float d = length(xy);
if (d < (2.0-maxFactor)) {
d = length(xy * maxFactor);
@@ -20,7 +20,7 @@ void main(void) {
uv.x = r * cos(phi) + 0.5;
uv.y = r * sin(phi) + 0.5;
} else {
uv = vTexCoord.xy;
uv = vTexCoord;
}
vec4 c = texture2D(tex0, uv);
gl_FragColor = c;
+1 -1
View File
@@ -1,6 +1,6 @@
#version 150
uniform sampler2D tex0;
in vec4 vTexCoord;
in vec2 vTexCoord;
out vec4 FragColor;
uniform float colors; // 12.0
+11 -8
View File
@@ -50,20 +50,23 @@ QString config_dir;
QString appName = "Olive (November 2018 | Alpha)";
bool demoNoticeShown = false;
void MainWindow::setup_layout() {
void MainWindow::setup_layout(bool reset) {
panel_project->show();
panel_effect_controls->show();
panel_footage_viewer->show();
panel_sequence_viewer->show();
panel_timeline->show();
bool load_default = true;
QFile panel_config(get_data_path() + "/layout");
if (panel_config.exists() && panel_config.open(QFile::ReadOnly)) {
if (restoreState(panel_config.readAll(), 0)) {
load_default = false;
if (!reset) {
QFile panel_config(get_data_path() + "/layout");
if (panel_config.exists() && panel_config.open(QFile::ReadOnly)) {
if (restoreState(panel_config.readAll(), 0)) {
load_default = false;
}
panel_config.close();
}
panel_config.close();
}
if (load_default) {
@@ -131,7 +134,7 @@ MainWindow::MainWindow(QWidget *parent) :
panel_effect_controls = new EffectControls(this);
panel_timeline = new Timeline(this);
setup_layout();
setup_layout(false);
connect(ui->menuWindow, SIGNAL(aboutToShow()), this, SLOT(windowMenu_About_To_Be_Shown()));
connect(ui->menu_View, SIGNAL(aboutToShow()), this, SLOT(viewMenu_About_To_Be_Shown()));
@@ -515,7 +518,7 @@ void MainWindow::on_actionDeselect_All_triggered()
void MainWindow::on_actionReset_to_default_layout_triggered()
{
setup_layout();
setup_layout(true);
}
void MainWindow::on_actionGo_to_start_triggered()
+1 -1
View File
@@ -206,7 +206,7 @@ private slots:
private:
Ui::MainWindow *ui;
void setup_layout();
void setup_layout(bool reset);
bool save_project_as();
bool save_project();
bool can_close_project();