Skip to content

Commit

Permalink
offsetY arg
Browse files Browse the repository at this point in the history
  • Loading branch information
egemenertugrul committed Sep 12, 2023
1 parent d1e2aec commit dbd6e28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions owxr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ void DrawFilledCircle(float x, float y, float radius, float fillAmount, Color co
int main(int argc, char* argv[])
{
float ipd = 0.063f;
float offsetX = 0.0565f;
float offsetX = 0.0f;
float offsetY = 0.0f;

for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--desktop") == 0) {
Expand All @@ -258,14 +259,13 @@ int main(int argc, char* argv[])
isStandardControls = true;
}
else if (strcmp(argv[i], "--ipd") == 0 && i + 1 < argc) {
// Check if there is another argument after --ipd and it exists
// Assuming you want to convert the next argument to an integer
ipd = atoi(argv[i + 1]);
ipd = atof(argv[i + 1]);
}
else if (strcmp(argv[i], "--offsetX") == 0 && i + 1 < argc) {
// Check if there is another argument after --ipd and it exists
// Assuming you want to convert the next argument to an integer
offsetX = atoi(argv[i + 1]);
offsetX = atof(argv[i + 1]);
}
else if (strcmp(argv[i], "--offsetY") == 0 && i + 1 < argc) {
offsetY = atof(argv[i + 1]);
}
}

Expand Down Expand Up @@ -329,7 +329,7 @@ int main(int argc, char* argv[])
//Shader distortion = LoadShader(0, TextFormat("resources/distortion%i.fs", GLSL_VERSION));
Shader distortion = LoadShader(0, "resources/distortion_openwixr_120.fs");

const float _offset[] = { offsetX, 0.0f };
const float _offset[] = { offsetX, offsetY };
const float _distortion[] = { 0.3f };
const float _cubicDistortion[] = { 0 };
const int _isRight[] = { 0 };
Expand Down
2 changes: 1 addition & 1 deletion resources/distortion_openwixr_120.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ vec2 barrel(vec2 uv) {
vec2 ret = vec2(f * h.x + center.x, h.y + dec);

if (ret.x < 0.0 || ret.x > 1.0 || ret.x > center.x * 2.0 || ret.x < center.x - leftScreenCenter.x || ret.y < 0.0 || ret.y > 1.0) {
return vec2(-5.0, -5.0);
return vec2(-1.0, -1.0);
}

return ret;
Expand Down

0 comments on commit dbd6e28

Please sign in to comment.