Questions about application "windows" (multi-platform)

Started by Yellownakji, April 30, 2019, 06:18:12

Previous topic - Next topic

Yellownakji

I have a few questions regarding Blitzmax-NG in MAX2D mode with "windows".

- Is borderless in BMXNG possible with Max2D?  Is borderless possible, periord? (Win,Linux,MacOS)
- Can i prevent a window from being drag-able?
- Can i manually tell the app to start at specific coordinates on the desktop, instead of centered?

I'm re-creating a project that i've lost the source too.  Borderless, not draggable and 'spawned' the the bottom right corner.  Specific traits i need.

Derron

In Linux it's not up to the application but the window manager to limit stuff, apps can just hmm "signal their wishes".

Borderless is a matter of the window creation - so it should "just" need the right flags when doing so.
with "sdl.mod" (or here sdl.sdlvideo) you gain access to:
Code (BlitzMax) Select

Type TSDLVideo
[...]
Rem
bbdoc: Sets the border state of the window.
about: This will add or remove the window's SDL_WINDOW_BORDERLESS flag and add or remove the border from the actual window.
This is a no-op if the window's border already matches the requested state.
You can't change the border state of a fullscreen window.
End Rem
Method SetBordered(bordered:Int)
SDL_SetWindowBordered(windowPtr, bordered)
End Method



The same code file has this:
Code (BlitzMax) Select

Rem
bbdoc: Creates a window with the specified position, dimensions, and flags.
returns: The window that was created or Null on failure.
End Rem
Function Create:TSDLWindow(title:String, x:Int, y:Int, w:Int, h:Int, flags:UInt)
Return _create(bmx_sdl_video_CreateWindow(title, x, y, w, h, flags))
End Function


The SDLGraphicsDriver calls this function with X and Y defined as SDL_WINDOWPOS_CENTERED.

If you created it with "SDL_CreateShapedWindow" then you would have borderless by default.


For now I think you would be needed to modify sdl.mod/* stuff. I will ask  Brucey if it was ok to alter the code to allow for some "configuration" before opening up a window (position, borderless, ...).


Edit: currently sdl.SDLGraphics pass the given "flags" on graphics creation to the window creation. So doing a
Graphics 800,600,0,SDL_WINDOW_BORDERLESS | SDL_GRAPHICS_NATIVE
should already pass it.
This "SDL_GRAPHICS_NATIVE" is required to pass the SDL_...config

Means you need to manually pass these if desired:
SDL_GRAPHICS_BACKBUFFER | SDL_GRAPHICS_ALPHABUFFER | SDL_GRAPHICS_DEPTHBUFFER | SDL_GRAPHICS_STENCILBUFFER | SDL_GRAPHICS_ACCUMBUFFER
(compared to the GRAPHICS_BACKBUFFER ... etc commands)



bye
Ron