emulate fullscreen with b3d (i can't do it yet)

Started by Santiago, April 09, 2020, 04:37:32

Previous topic - Next topic

Santiago


I could never have with blitz3d the possibility of removing the "Titlebar" from windows. to simulate fullscreen but in windowed mode.

It is a myth ?, I could never do it, I did not find the dlls and I did not know how to use the ones that I found.

Could someone do it with b3d? Would you be so kind as to share an example?

regards!!!!

Dan

Yes, with Userlibs functions.
But the screen content is zoomed up/down to the desktop resolution (per hardware zoom).

This is (one of) the function, which i use to replace (or to make easier) the Graphic call.

usage: Screen (H,W,mode)

mode:
-1 is doing what you are asking. (fake fullscreen (low res content is zoomed), borderless window - no titlebar and the taskbar is hidden, at least here on my win10)
0 stretches the window to the desktop dimension
1 = Window in resolution H,W
2 or more = window in resolution H*typ, W*typ. - the drawing is still done on the H,W screen, but the window and its content is stretched (zoomed) to the mode.


Screen(320,200,-1)

Print "hi"
WaitKey()
End

Function Screen(x,y,full=0)
;fill <0 = Fulldesktop, borderless window
;full =0 = Fulldesktop
;full =1 = original x,y
;full >1-5 = x*full,y*full size
;full >5 = 0
DeskX=api_GetSystemMetrics(0)
DeskY=api_GetSystemMetrics(1)
If x>DeskX Then x=DeskX
    If x<64 Then x=64
If y>DeskY Then y=DeskY
    If y<64 Then y=64
    bits=api_GetDeviceCaps(api_GetDC( api_GetDesktopWindow()),12)
Graphics x,y,bits,6
Graphics x,y,bits,7
If full<=0 Or full>5
If full<0 Then api_SetWindowLong(api_GetActiveWindow(), -16, $10000000)
api_MoveWindow(api_GetActiveWindow(),0,0,DeskX,DeskY,True)
    EndIf
If full>1 And full<=5 Then api_MoveWindow(api_GetActiveWindow(),0,0,x*full,y*full,True)
End Function


The required userlibs are:

User32.decls   

.lib "user32.dll"
api_GetSystemMetrics% (nIndex%) : "GetSystemMetrics"
api_GetActiveWindow%():"GetActiveWindow"
api_GetDC% (hwnd%) : "GetDC"
api_GetDesktopWindow% () : "GetDesktopWindow"
api_MoveWindow% (hwnd%, x%, y%, nWidth%, nHeight%, bRepaint%) : "MoveWindow"
api_SetWindowLong% (hwnd%, nIndex%, dwNewLong%) : "SetWindowLongA"


GDI32.decls

.lib "gdi32.dll"
api_GetDeviceCaps% (hdc%, nIndex%) : "GetDeviceCaps"


Copy the text into your text editor and save the two files into the blitz3d userlib folder, (or add the lines if you have the decls files, if they are not there allready)

(you can get the full decls (kernel, gdi32, user32) from here: Blitzbasic codearchive)
65536 GOTO Back2Basic

Santiago

Thanks Dan..

i try,i have my decls file in userlibes. but i have the next error. when compile to run text

function 'api_getdc' not found
Api_setwindowslong not found

maibe i need a dll in the directory?

im realy bad with this kind of things.


Dan

Quote
Api_setwindowslong not found

Thanks for pointing it out, there was one declaration missing:

add this to the user32.decls

api_SetWindowLong% (hwnd%, nIndex%, dwNewLong%) : "SetWindowLongA"


lets see if that fixes the problem.

User32 and gdi32 dll's  are widows own dll's, you shouldn't need them, if you are running b3d on windows.
65536 GOTO Back2Basic

Dan

65536 GOTO Back2Basic


Santiago

Hi RemiD, this link dosen't work, is working?

Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Santiago

Ohhh  :o.

is strange, only works for me if i open using TOR browser.   strange!!

thanks!

Santiago

i try the code, but still have compiling error

Function 'user32_findwindows' not found.

i try to put dll, decls, but still have the problems, i never understand dlls files. im a prehistoric man.

can you give me the light, i trying to make this work so many time ago :) lol.

Santiago

hi, today i was trying to get the user32.decls functions working, delete my userlibs directory

C: \ Program Files (x86) \ Blitz3D \ userlibs

Is it possible that this does not work for me because of the permissions to access these directories?

if I want to modify a file inside that directory it won't let me, download files, .bb programs, I don't know what to do to make it work.

Dan

You can test it,

Copy the b.basic folder from program files into, for e.g. C:\BB3D\ and start the blitzide from there.
65536 GOTO Back2Basic

Santiago

i go to try.

i need to have user32.decls in blitz3d\userlibs


and i need the user32.dll file in the game directory? or is no need ?

Dan

#13
No, user32.dll is a part of windows.

It is enough to have the user32.decls in the userlibs folder.
65536 GOTO Back2Basic