<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Display — Orx: Portable Game Engine</title>
      <link>https://forum.orx-project.org/index.php?p=/</link>
      <pubDate>Thu, 21 May 2026 17:40:26 +0000</pubDate>
          <description>Display — Orx: Portable Game Engine</description>
    <language>en</language>
    <atom:link href="https://forum.orx-project.org/index.php?p=/discussions/tagged/display/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Windows UI Scaling Causes Screen Size To Be Incorrect</title>
        <link>https://forum.orx-project.org/index.php?p=/discussion/9075/windows-ui-scaling-causes-screen-size-to-be-incorrect</link>
        <pubDate>Sat, 28 Dec 2019 15:44:44 +0000</pubDate>
        <category>Help request</category>
        <dc:creator>Freedom</dc:creator>
        <guid isPermaLink="false">9075@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Is there a way to detect the UI scaling and adjust the screen size correctly?</p>

<p>I'm specifically talking about the Windows setting <strong>System &gt; Display &gt; Scale and layout &gt; Change the size of text, apps, and other items</strong>.</p>

<p>When this is set to anything other than 100%, it causes only screen size (orxDisplay_GetScreenSize) to be scaled. The mouse position is <strong>not</strong> scaled with the screen size. This cascades and causes mouse to world coordinates and object placement to be calculated incorrectly.</p>

<p>I've posted an example below. With Scale set to 100%, left clicking the mouse makes the orx logo follow the mouse. If the scale is set higher, the orx logo is no longer placed under the mouse correctly. When the mouse is in the top left corner, the logo is underneath the mouse pointer. As you move the mouse down and to the right, the logo moves at scale across the screen the same direction. (i.e. When the mouse will move 100 pixels to the right, the logo moves much more than 100 pixels to the right.)</p>

<p>How can I prevent this from happening, other than forcing a user to change the setting to 100% which may make other parts of the screen hard to read?</p>

<p>LogoTest.ini</p>

<pre><code>; LogoTest - Template basic config file

[Display]
Title           = LogoTest
FullScreen      = false
Decoration      = false
Smoothing       = true
VSync           = true

[Resource]
Texture         = ../data/texture
Sound           = ../data/sound

[Input]
SetList         = MainInput

[MainInput]
KEY_ESCAPE      = Quit
MOUSE_LEFT      = MouseLeft

[Viewport]
Camera          = Camera

[Camera]
FrustumWidth    = 1280
FrustumHeight   = 720
FrustumFar      = 2
FrustumNear     = 0
Position        = (0, 0, -1) ; Objects with -1 &lt;= Z &lt;= 1 will be visible
GroupList       = Logo

[Object]
Graphic         = @
Texture         = logo.png
SoundList       = @
Sound           = appear.ogg
Pivot           = center
AngularVelocity = 18
FXList          = FadeIn # ColorCycle
Group           = Logo

[FadeIn]
SlotList        = @
Type            = alpha
Curve           = smooth
StartTime       = 0
EndTime         = 1.5
StartValue      = -1
EndValue        = 0

[ColorCycle]
Loop            = true
SlotList        = @
Type            = hsv
Curve           = linear
Absolute        = true
StartTime       = 0
EndTime         = 6
StartValue      = (0, 1, 1)
EndValue        = (1, 1, 1)
</code></pre>

<p>Visual Studio 2019 (Community Edition)<br />
LogoTest.cpp</p>

<pre><code>/**
 * @file LogoTest.cpp
 * @date 27-Dec-2019
 */

#include &quot;orx.h&quot;

void orxFASTCALL InputUpdate(const orxCLOCK_INFO* _pstClockInfo, void* _pstContext)
{
    const orxSTRINGID logoID = orxString_GetID(&quot;Logo&quot;);
    orxOBJECT* logoObj;

    if (orxInput_IsActive(&quot;MouseLeft&quot;))
    {
        orxVECTOR mousePosition = orxVECTOR_0;
        orxMouse_GetPosition(&amp;mousePosition);
        orxLOG(&quot;Mouse position X '%f' Y '%f' Z '%f'&quot;, mousePosition.fX, mousePosition.fY, mousePosition.fZ);
        orxRender_GetWorldPosition(&amp;mousePosition, orxNULL, &amp;mousePosition);
        orxLOG(&quot;Mouse world position X '%f' Y '%f' Z '%f'&quot;, mousePosition.fX, mousePosition.fY, mousePosition.fZ);
        mousePosition.fZ = 0;
        logoObj = orxObject_GetNext(orxNULL, logoID);
        orxObject_SetPosition(logoObj, &amp;mousePosition);
    }
}

orxSTATUS orxFASTCALL Init()
{
    orxCLOCK* pstMainClock;
    orxFLOAT width = orxFLOAT_0;
    orxFLOAT height = orxFLOAT_0;
    orxINPUT_TYPE   eType;
    orxENUM         eID;
    orxINPUT_MODE   eMode;
    const orxSTRING zMouseLeft;

    /* Gets input binding names */
    orxInput_GetBinding(&quot;MouseLeft&quot;, 0, &amp;eType, &amp;eID, &amp;eMode);
    zMouseLeft = orxInput_GetBindingName(eType, eID, eMode);

    // Create the viewport
    orxViewport_CreateFromConfig(&quot;Viewport&quot;);

    // Create the object
    orxOBJECT* obj = orxObject_CreateFromConfig(&quot;Object&quot;);
    orxDisplay_GetScreenSize(&amp;width, &amp;height);
    orxLOG(&quot;Screen width '%f' height '%f'&quot;, width, height);

    pstMainClock = orxClock_FindFirst(orx2F(-1.0f), orxCLOCK_TYPE_CORE);
    orxClock_Register(pstMainClock, InputUpdate, orxNULL, orxMODULE_ID_MAIN, orxCLOCK_PRIORITY_NORMAL);

    // Done!
    return orxSTATUS_SUCCESS;
}

orxSTATUS orxFASTCALL Run()
{
    orxSTATUS eResult = orxSTATUS_SUCCESS;

    // Should quit?
    if(orxInput_IsActive(&quot;Quit&quot;))
    {
        // Update result
        eResult = orxSTATUS_FAILURE;
    }

    // Done!
    return eResult;
}

void orxFASTCALL Exit()
{
    // Let Orx clean all our mess automatically. :)
}

orxSTATUS orxFASTCALL Bootstrap()
{
    orxResource_AddStorage(orxCONFIG_KZ_RESOURCE_GROUP, &quot;../data/config&quot;, orxFALSE);

    return orxSTATUS_SUCCESS;
}

/** Main function
 */
int main(int argc, char **argv)
{
    orxConfig_SetBootstrap(Bootstrap);

    orx_Execute(argc, argv, Init, Run, Exit);

    return EXIT_SUCCESS;
}
</code></pre>
]]>
        </description>
    </item>
    <item>
        <title>New project doesn't work in windowed</title>
        <link>https://forum.orx-project.org/index.php?p=/discussion/9059/new-project-doesnt-work-in-windowed</link>
        <pubDate>Fri, 08 Nov 2019 08:45:03 +0000</pubDate>
        <category>Help request</category>
        <dc:creator>Vick</dc:creator>
        <guid isPermaLink="false">9059@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Hello,</p>

<p>When I create a new project the game is always in fullscreen. When I edit the main ini file i've FullScreen to false, even when I use <code>orxDisplay_SetFullScreen(false);</code> I  still have my game in fullscreen.</p>

<p>Did i miss something ?</p>

<p>If I add ScreenWidth &amp; ScreenHeight in my Display section for something like 1280/720 I'm still in fullscreen but borderless. (see screenshot)</p>

<p><img src="https://orx-project.org/forum/uploads/editor/fc/6dy8c1nx5tnq.png" alt="" title="" /></p>

<p>Thanks</p>
]]>
        </description>
    </item>
    <item>
        <title>Is there a way to perfectly center a windowed app to the user's resolution?</title>
        <link>https://forum.orx-project.org/index.php?p=/discussion/9040/is-there-a-way-to-perfectly-center-a-windowed-app-to-the-users-resolution</link>
        <pubDate>Sat, 10 Aug 2019 07:17:46 +0000</pubDate>
        <category>Help request</category>
        <dc:creator>GaryM</dc:creator>
        <guid isPermaLink="false">9040@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>I can't seem to find any way to find the center of the screen width and height through the config.<br />
I'd imagine it looks something like this, where "Center?" is the correct way to get the width/2 and height/2 of the screen's reported resolution.</p>

<p><code>[Display]</code><br />
<code>ScreenPosition  = (Center?, Center?)</code></p>

<p>If it can't be done through the config, then how would it be done through my source file, in c++?</p>
]]>
        </description>
    </item>
    <item>
        <title>RefreshRate usage?</title>
        <link>https://forum.orx-project.org/index.php?p=/discussion/9031/refreshrate-usage</link>
        <pubDate>Mon, 03 Jun 2019 22:56:01 +0000</pubDate>
        <category>General discussions</category>
        <dc:creator>sausage</dc:creator>
        <guid isPermaLink="false">9031@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>What are the rules around using RefreshRate under the Display section?</p>

<p>It has to be Fullscreen = true I am sure.</p>

<p>Is it possible to have a RefreshRate of say... 2 on a 60hz screen refresh?</p>
]]>
        </description>
    </item>
   <language>en</language>
   </channel>
</rss>
