switchbrew / libnx

Library for Switch Homebrew
https://switchbrew.github.io/libnx/
ISC License
1.26k stars 167 forks source link

when trying to use crop on horizontal resolution, switch crashes #89

Closed ericde45 closed 6 years ago

ericde45 commented 6 years ago

hello

with the following code, i am able to create a crop at the top of the screen, so that the first 12 lines are not displayed :

    gfxConfigureCrop(0, 12, 0, 0); 
    gfxInitResolution(1280, 732);
    gfxConfigureResolution(1280,720);
    gfxInitDefault();

checking for resolution, i get 1280*732

but when using this , to have an horizontal crop :

    gfxConfigureCrop(32, 12, 0, 0); 
    gfxInitResolution(1280+32, 732);
    gfxConfigureResolution(1280,720);
    gfxInitDefault();

i get a crash with error 2345-0018

am i missing a point ? or is it a bug ?

thanks

my switch is 3.0.0, running HBL through pegaswitch

fincs commented 6 years ago

Seems to be LibnxError_BadGfxInit

yellows8 commented 6 years ago

Use:

gfxConfigureCrop(<crop left>, <crop top>, 1280, 720);
gfxInitDefault();
ericde45 commented 6 years ago

i made more tests it seem to zoom the graphical display to fit in the crop part i thin ki misunderstood the use of crop i am searching for a way to have a larger screen but with a 1280*720 display, with borders not displayed for example a line of 1600 pixels, with 1280 displayed and the ability to move the frame buffer start

if you have advices for this, they are welcome.

thanks

yellows8 commented 6 years ago
gfxInitResolutionDefault();
gfxInitDefault();
...
gfxConfigureCrop(...);