BASIC

Author Topic: SDL2 screen offset  (Read 2343 times)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
SDL2 screen offset
« on: 2013-Jan-14 »
Howdy,

I've ported to SDL2 now, but in portrait, the opengl window on android is shifted towards the bottom. The touches are proper coords. Any ideas?

Offline belial

  • Mc. Print
  • *
  • Posts: 19
    • View Profile
Re: SDL2 screen offset
« Reply #1 on: 2013-Jan-15 »
could it be something about the system app bar? I had a problem like this in wince a long time ago.

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2624
    • View Profile
Re: SDL2 screen offset
« Reply #2 on: 2013-Jan-15 »
Sounds like the width and height are the wrong way around?
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
SDL2 screen offset
« Reply #3 on: 2013-Jan-15 »
Oh. Hot guess. Because the offset is quite someting. I guess 100 px. On a 768x1024 device that would be (1024-768)/2. I have to try later.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: SDL2 screen offset
« Reply #4 on: 2013-Jan-15 »
No.
Also, the right side is too small - like 500 instead of 768 pixels. Very strange.

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2624
    • View Profile
Re: SDL2 screen offset
« Reply #5 on: 2013-Jan-15 »
Try a glGetIntegerv(GL_VIEWPORT, viewport), after init, to see what the render context has been set up as?
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
SDL2 screen offset
« Reply #6 on: 2013-Jan-17 »
The screen size wasn't passed to the core. I had 640x480 in project settings.
For android I ignore these completely now.

MrTAToad

  • Guest
Re: SDL2 screen offset
« Reply #7 on: 2013-Jan-18 »
Is SDL 2 going to be used for all platforms ?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
SDL2 screen offset
« Reply #8 on: 2013-Jan-20 »
That's a plan. I hope to be able to statically link it so we don't need dlls. That way we have full sdl_mixer support and can have wave transformation callbacks ( pitch)...

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3366
  • Integrated Brain
    • View Profile
Re: SDL2 screen offset
« Reply #9 on: 2013-Jan-20 »
Very very interesting this about sounds.... :nw: :nw:  I have a lot of hype about this Release... the Html5, can be simple awesome...

MrTAToad

  • Guest
Re: SDL2 screen offset
« Reply #10 on: 2013-Jan-21 »
That would be good!

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2624
    • View Profile
Re: SDL2 screen offset
« Reply #11 on: 2013-Jan-21 »
That's a plan. I hope to be able to statically link it so we don't need dlls. That way we have full sdl_mixer support and can have wave transformation callbacks ( pitch)...
Ah, being able to change pitch on the fly will make a lot of new app designs possible! :D
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

MrTAToad

  • Guest
Re: SDL2 screen offset
« Reply #12 on: 2013-Jan-21 »
Especially if it can handle OGG files too :)

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2624
    • View Profile
Re: SDL2 screen offset
« Reply #13 on: 2013-Jan-21 »
Yes, SDL Buffers too (Synthesised waveforms for soft synths)!  :good:
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)