-
Notifications
You must be signed in to change notification settings - Fork 396
Add mode Bm #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mode Bm #146
Changes from all commits
905c639
736daf6
26b0dc2
baaa458
8983eff
7561ff0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,20 @@ int cimbare_init_window(int width, int height) | |
| return 0; | ||
| } | ||
|
|
||
| int cimbare_rotate_window(bool rotate) | ||
| { | ||
| if (!_window or !_window->is_good()) | ||
| return -1; | ||
|
|
||
| _window->rotate(0); | ||
| if (rotate) // 90 degrees | ||
| { | ||
| _window->rotate(); | ||
| _window->rotate(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing rotation implementation has a weird rotation order due to what I initially implemented it for (an alternative attempt at the "shakycam" jitter we use to fast-fail bad frames). So 90 degrees is 2 "rotations", even though that makes no sense. (will probably change it to act normal in a followup) |
||
| } | ||
| return 0; | ||
| } | ||
|
|
||
| bool cimbare_auto_scale_window() | ||
| { | ||
| if (!_window or !_window->is_good()) | ||
|
|
@@ -181,9 +195,7 @@ int cimbare_encode(const unsigned char* buffer, unsigned size) | |
|
|
||
| int cimbare_configure(int mode_val, int compression) | ||
| { | ||
| // defaults | ||
| if (mode_val == 0) | ||
| mode_val = 68; | ||
| cimbar::Config::update(mode_val); | ||
| if (compression < 0 or compression > 22) | ||
| compression = cimbar::Config::compression_level(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ class window_glfw | |
| glfwMakeContextCurrent(_w); | ||
| glfwSwapInterval(1); | ||
|
|
||
| _display = std::make_shared<cimbar::gl_2d_display>(std::min(width, height)); | ||
| _display = std::make_shared<cimbar::gl_2d_display>(std::max(width, height)); | ||
| glGenTextures(1, &_texid); | ||
| init_opengl(width, height); | ||
| } | ||
|
|
@@ -72,7 +72,13 @@ class window_glfw | |
| void resize(unsigned width, unsigned height) | ||
| { | ||
| if (_w) | ||
| { | ||
| _width = width; | ||
| _height = height; | ||
| glfwSetWindowAspectRatio(_w, width, height); | ||
| glfwSetWindowSize(_w, width, height); | ||
| init_opengl(width, height); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resize() has to be a bit smarter now... |
||
| } | ||
| } | ||
|
|
||
| void rotate(unsigned i=1) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit of code is duplicated a few places. Probably time to split it out (realistically: next time I add a new config)