Comments (5)
So it appears that this is intentional because glfw is adjusting the screen size based on the dpi. However, this yields unexpected results when attempting to display shapes relative to the screen proportions. For example, the below code requires a transform of 0,200 to display shapes at 0,0 in the upper left hand corner.
gs_vec2 screenSize = gs_platform_window_sizev(gs_platform_main_window());
gs_println("screen size: %f, %f", screenSize.x, screenSize.y);
gsi_camera2D(&gsi);
gsi_push_matrix(&gsi, GSI_MATRIX_MODELVIEW);
// The below rectangle and circle are NOT displayed at origin without this transform:
// gsi_transf(&gsi, 0.f, 200.f, 0.f);
gsi_rectv(&gsi, gs_v2(0.f, 0.f), screenSize, GS_COLOR_GREEN, GS_GRAPHICS_PRIMITIVE_LINES);
gsi_circle(&gsi, 0.f, 0.f, 50.f, 20, 100, 150, 220, 255, GS_GRAPHICS_PRIMITIVE_TRIANGLES);
gsi_pop_matrix(&gsi);
from gunslinger.
Even running the example 14_immediate_draw doesn't display the full example, it's extremely zoomed in.
from gunslinger.
As I thought, this was due to the windows setting scaling everything.
I do think this still counts as a bug, because this setting will totally ruin the display of users who have scaling on.
from gunslinger.
Here are pictures with the "Scale and Layout" percentage set to 150% and 100% respectively.
150%
100%
from gunslinger.
Fixed
from gunslinger.
Related Issues (20)
- gs_audio: Use-after-free crash on exit HOT 1
- Use cmake? HOT 2
- _CRT_SECURE_NO_WARNINGS required to build on default visual studio 2017.
- Possible discussions tab HOT 1
- static lib failing on linux HOT 2
- Usage of non C99 features HOT 1
- 2D camera immediate GUI avoid flipping textures
- DPI management impact in immediate draw
- resource update before command buffer submit HOT 2
- Uniform Arrays handling HOT 4
- VSync issue regression HOT 1
- gsgl_pipeline_state incorrectly disabling GL_SCISSOR_TEST HOT 2
- I have Question about uninitialized variable in gs_audio_impl.h HOT 1
- crash when loading gLTF model with multiple meshes
- need way to query global os UI scale
- Compile error with gcc, on macos 10.12.
- Scaling issue with fullscreen window flag
- add GS_GUI_OPT_BRINGTOFRONT
- The Docsforge link is dead
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gunslinger.