October 26, 2020, 01:57:14 AM

Author Topic: emulate fullscreen with b3d (i can't do it yet)  (Read 917 times)

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
emulate fullscreen with b3d (i can't do it yet)
« on: April 09, 2020, 04:37:32 AM »

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!!!!

Offline Dan

  • Jr. Member
  • **
  • Posts: 36
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #1 on: April 09, 2020, 08:51:52 AM »
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.

Code: [Select]
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   
Code: [Select]
.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
Code: [Select]
.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

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #2 on: April 09, 2020, 03:40:44 PM »
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.


Offline Dan

  • Jr. Member
  • **
  • Posts: 36
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #3 on: April 10, 2020, 08:44:40 AM »
Quote
Api_setwindowslong not found

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

add this to the user32.decls
Code: [Select]
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

Offline Dan

  • Jr. Member
  • **
  • Posts: 36
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #4 on: April 10, 2020, 08:50:16 AM »
double post
65536 GOTO Back2Basic

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1064
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #6 on: April 28, 2020, 06:26:35 PM »
Hi RemiD, this link dosen't work, is working?

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2819
  • elgol 2021
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #7 on: April 28, 2020, 06:33:04 PM »
That link works here.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry Pi 3 and 4

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #8 on: April 29, 2020, 12:48:38 AM »
Ohhh  :o.

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

thanks!

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #9 on: April 29, 2020, 01:12:39 AM »
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.

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #10 on: April 29, 2020, 09:59:28 PM »
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.

Offline Dan

  • Jr. Member
  • **
  • Posts: 36
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #11 on: April 30, 2020, 03:52:57 PM »
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

Offline Santiago

  • Sr. Member
  • ****
  • Posts: 276
  • Blitz3d
    • Indiesoft
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #12 on: April 30, 2020, 05:35:30 PM »
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 ?

Offline Dan

  • Jr. Member
  • **
  • Posts: 36
Re: emulate fullscreen with b3d (i can't do it yet)
« Reply #13 on: April 30, 2020, 07:18:05 PM »
No, user32.dll is a part of windows.

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

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal