|
316 | 316 | +FillTexturedPolygon() - Hijacks DecalStructure for configuration |
317 | 317 | +olc::vf2d arguments for Sprite::Sample() functions |
318 | 318 | 2.22: = Fix typo on dragged file buffers for unicode builds |
| 319 | + 2.23: Fixed Emscripten host sizing errors - Thanks Moros |
| 320 | + Fixed v2d_generic.clamp() function |
319 | 321 | |
320 | 322 | !! Apple Platforms will not see these updates immediately - Sorry, I dont have a mac to test... !! |
321 | 323 | !! Volunteers willing to help appreciated, though PRs are manually integrated with credit !! |
@@ -395,7 +397,7 @@ int main() |
395 | 397 | #include <cstring> |
396 | 398 | #pragma endregion |
397 | 399 |
|
398 | | -#define PGE_VER 222 |
| 400 | +#define PGE_VER 223 |
399 | 401 |
|
400 | 402 | // O------------------------------------------------------------------------------O |
401 | 403 | // | COMPILER CONFIGURATION ODDITIES | |
@@ -683,7 +685,7 @@ namespace olc |
683 | 685 | v2d_generic min(const v2d_generic& v) const { return v2d_generic(std::min(x, v.x), std::min(y, v.y)); } |
684 | 686 | v2d_generic cart() { return { std::cos(y) * x, std::sin(y) * x }; } |
685 | 687 | v2d_generic polar() { return { mag(), std::atan2(y, x) }; } |
686 | | - v2d_generic clamp(const v2d_generic& v1, const v2d_generic& v2) const { return this->max(v1)->min(v2); } |
| 688 | + v2d_generic clamp(const v2d_generic& v1, const v2d_generic& v2) const { return this->max(v1).min(v2); } |
687 | 689 | v2d_generic lerp(const v2d_generic& v1, const double t) { return this->operator*(T(1.0 - t)) + (v1 * T(t)); } |
688 | 690 | T dot(const v2d_generic& rhs) const { return this->x * rhs.x + this->y * rhs.y; } |
689 | 691 | T cross(const v2d_generic& rhs) const { return this->x * rhs.y - this->y * rhs.x; } |
@@ -1358,8 +1360,9 @@ namespace olc |
1358 | 1360 | #endif |
1359 | 1361 |
|
1360 | 1362 | #if defined(OLC_PLATFORM_X11) |
1361 | | - namespace X11 |
1362 | | - {#include <GL/glx.h>} |
| 1363 | + namespace X11 { |
| 1364 | + #include <GL/glx.h> |
| 1365 | + } |
1363 | 1366 | #define CALLSTYLE |
1364 | 1367 | #endif |
1365 | 1368 |
|
@@ -4595,17 +4598,17 @@ namespace olc |
4595 | 4598 | // #include <OpenGL/glu.h> |
4596 | 4599 | //#endif |
4597 | 4600 |
|
4598 | | -//#if defined(OLC_PLATFORM_EMSCRIPTEN) |
4599 | | -// #include <EGL/egl.h> |
4600 | | -// #include <GLES2/gl2.h> |
4601 | | -// #define GL_GLEXT_PROTOTYPES |
4602 | | -// #include <GLES2/gl2ext.h> |
4603 | | -// #include <emscripten/emscripten.h> |
4604 | | -// #define CALLSTYLE |
4605 | | -// typedef EGLBoolean(locSwapInterval_t)(EGLDisplay display, EGLint interval); |
4606 | | -// #define GL_CLAMP GL_CLAMP_TO_EDGE |
4607 | | -// #define OGL_LOAD(t, n) n; |
4608 | | -//#endif |
| 4601 | +#if defined(OLC_PLATFORM_EMSCRIPTEN) |
| 4602 | + #include <EGL/egl.h> |
| 4603 | + #include <GLES2/gl2.h> |
| 4604 | + #define GL_GLEXT_PROTOTYPES |
| 4605 | + #include <GLES2/gl2ext.h> |
| 4606 | + #include <emscripten/emscripten.h> |
| 4607 | + #define CALLSTYLE |
| 4608 | + typedef EGLBoolean(locSwapInterval_t)(EGLDisplay display, EGLint interval); |
| 4609 | + #define GL_CLAMP GL_CLAMP_TO_EDGE |
| 4610 | + #define OGL_LOAD(t, n) n; |
| 4611 | +#endif |
4609 | 4612 |
|
4610 | 4613 | namespace olc |
4611 | 4614 | { |
@@ -6319,8 +6322,8 @@ namespace olc |
6319 | 6322 | let isFullscreen = (document.fullscreenElement != null); |
6320 | 6323 |
|
6321 | 6324 | // get the width of the containing element |
6322 | | - let width = (isFullscreen || !Module.olc_AssumeDefaultShells) ? window.innerWidth : Module.canvas.parentNode.clientWidth; |
6323 | | - let height = (isFullscreen || !Module.olc_AssumeDefaultShells) ? window.innerHeight : Module.canvas.parentNode.clientHeight; |
| 6325 | + let width = (isFullscreen) ? window.innerWidth : Module.canvas.parentNode.clientWidth; |
| 6326 | + let height = (isFullscreen) ? window.innerHeight : Module.canvas.parentNode.clientHeight; |
6324 | 6327 |
|
6325 | 6328 | // calculate the expected viewport size |
6326 | 6329 | let viewWidth = width; |
|
0 commit comments