Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 1,507 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
"fullscreen-look-like" window mode #415694
01/22/13 15:29
01/22/13 15:29
Joined: Jan 2013
Posts: 17
B
BySharDe2 Offline OP
Newbie
BySharDe2  Offline OP
Newbie
B

Joined: Jan 2013
Posts: 17
Hey

In the manual of "video_set", there is a saying goes as "Thus setting a 1024x768 window on a 1024x768 desktop will always fail unless you remove border and title bar. "
But how to implement like this "unless"?

I tried a lot but failed, anyone help me?
I need to create a 1366*768 window on a 1366*768 desktop.
here is a fake implementation.
Code:
void main()
{
	level_load("");
	
	video_set(1366,760,0,2);
	//video_set(1366,768,0,2);
	//video_window(vector(0,0,0),nullvector,1,NULL);
	//video_window(vector(0.1,0.1,0),vector(1366,768,0),1,NULL);
	video_window(vector(0.1,0.1,0),nullvector,1,NULL);
	
	vec_set(sky_color.blue,nullvector);
}


Re: "fullscreen-look-like" window mode [Re: BySharDe2] #415695
01/22/13 15:37
01/22/13 15:37
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
this works for me.
You'll have 1 line of pixels overlapping on every side but I think thats okay
Code:
video_window(vector(-1, -1, 0), vector(sys_metrics(0) + 2, sys_metrics(1) + 2, 0), 1, NULL);
video_set(sys_metrics(0) + 2, sys_metrics(1) + 2, 0, 2);



POTATO-MAN saves the day! - Random
Re: "fullscreen-look-like" window mode [Re: BySharDe2] #415696
01/22/13 15:43
01/22/13 15:43
Joined: Jan 2013
Posts: 17
B
BySharDe2 Offline OP
Newbie
BySharDe2  Offline OP
Newbie
B

Joined: Jan 2013
Posts: 17
during the test, my result is like this,

video_set(1366,760,0,2); // almost OK
video_set(1368,760,0,2); // almost OK
video_set(1366,761,0,2); // failed --> 800x600

// looks like fullscreen but F11 tells it is 800 x 600.
// Is this "remove border and title bar"?
video_window(vector(0.1,0.1,0),vector(1366,768,0),1,NULL);

Re: "fullscreen-look-like" window mode [Re: BySharDe2] #415700
01/22/13 15:52
01/22/13 15:52
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
did you try what I suggested?


POTATO-MAN saves the day! - Random
Re: "fullscreen-look-like" window mode [Re: Kartoffel] #415701
01/22/13 15:52
01/22/13 15:52
Joined: Jan 2013
Posts: 17
B
BySharDe2 Offline OP
Newbie
BySharDe2  Offline OP
Newbie
B

Joined: Jan 2013
Posts: 17
Wow thanks for your fast reply.
Based on your code, It will work like this
The order of the two functions seems to be a problem.
Perfect without "a line border".
Code:
void main()
{
	level_load("");
	video_window(vector(0.1, 0.1, 0), vector(1366, 768,0), 1, NULL);
	video_set(1366, 768, 0, 2);
}


Re: "fullscreen-look-like" window mode [Re: BySharDe2] #415710
01/22/13 17:08
01/22/13 17:08
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
video window just changes the window size, but not the rendered resolution wink
that's why you have to use something like video_set afterwards


POTATO-MAN saves the day! - Random
Re: "fullscreen-look-like" window mode [Re: Kartoffel] #415714
01/22/13 17:23
01/22/13 17:23
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
some small snippet which applies this for all video resolutions:

Code:
#include <acknex.h>
#include <windows.h>

typedef void *HMONITOR;

typedef struct tagMONITORINFO
{
	DWORD cbSize;
	RECT  rcMonitor;
	RECT  rcWork;
	DWORD dwFlags;
} MONITORINFO;

long WINAPI MonitorFromWindow(long hwnd,long dwFlags);
#define PRAGMA_API MonitorFromWindow;user32!MonitorFromWindow

#define MONITOR_DEFAULTTONULL       0x00000000
#define MONITOR_DEFAULTTOPRIMARY    0x00000001
#define MONITOR_DEFAULTTONEAREST    0x00000002

function main()
{
	wait(1); // Wait because we need a window handle!
	video_window(NULL, NULL, 1, NULL);
	MONITORINFO info;
	memset(&info, 0, sizeof(MONITORINFO));
	info.cbSize = sizeof(MONITORINFO);
	HMONITOR primary = MonitorFromWindow(hWnd, MONITOR_DEFAULTTOPRIMARY);
	GetMonitorInfo(primary, &info);
	video_set(info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top, 32, 2);
	SetWindowPos(hWnd, HWND_TOP, info.rcWork.left, info.rcWork.top, info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top, SWP_SHOWWINDOW);
}



Visit my site: www.masterq32.de
Re: "fullscreen-look-like" window mode [Re: MasterQ32] #415717
01/22/13 17:28
01/22/13 17:28
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
you don't need windows.h in this case
there's already sys_metrics(); wink
0 and 1 return the x and y size

besides that using sys metrics is much easier for a beginner


POTATO-MAN saves the day! - Random
Re: "fullscreen-look-like" window mode [Re: Kartoffel] #415718
01/22/13 17:35
01/22/13 17:35
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
it's not complete fullscreen but more like fullscreen without the taskbar


Visit my site: www.masterq32.de
Re: "fullscreen-look-like" window mode [Re: MasterQ32] #415719
01/22/13 17:39
01/22/13 17:39
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Nothing against your solution, it's nice and gives a lot of other possibilities but if he just wants windowed fullscreen this is better, especially for a beginner:
Code:
#include <acknex.h>

function main()
{
	wait(1);
	video_window(vector(0.1, 0.1, 0), vector(sys_metrics(0), sys_metrics(1), 0), 1, NULL);
	video_set(sys_metrics(0), sys_metrics(1), 0, 2);
}


(this one is better than my first suggestion, with this there are no overlapping pixels)

Last edited by Kartoffel; 01/22/13 17:43.

POTATO-MAN saves the day! - Random

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1