Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
0 registered members (), 1,438 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Toggling Fullscreen via Panel (W1246 D3DERR_INVALIDCALL) #239285
12/03/08 20:14
12/03/08 20:14
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
Toggling Fullscreen/Windowed mode via a panel will generate error W1246 (D3DERR_INVALIDCALL). Calling the exact same function through a keystroke will cause no such error.

Full source code:
Code:
#include <acknex.h>
#include <default.c>

var use_fullscreen = 0;
BMAP* square_bmap = "square.png";

function toggle_fullscreen() {
   use_fullscreen = !use_fullscreen;

   if(use_fullscreen) { video_switch (0,0,1); }
   else               { video_switch (0,0,2); }
}

PANEL* test_pan = {
   button(0, 0, square_bmap, square_bmap, square_bmap, toggle_fullscreen, NULL, NULL);
   flags = VISIBLE;
}

function main() {
   mouse_mode = 4;
   on_u = toggle_fullscreen;
   level_load("TestProject.wmb");
}


Clicking the panel button will cause the error, though only the first time. Pressing 'u' will never cause the error.

Re: Toggling Fullscreen via Panel (W1246 D3DERR_INVALIDCALL) [Re: Zelek] #239354
12/04/08 07:36
12/04/08 07:36
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
This code is wrong. You can not switch video in a panel event - see manual. Correct is:

function toggle_fullscreen() {
wait(1);
use_fullscreen = !use_fullscreen;
...




Re: Toggling Fullscreen via Panel (W1246 D3DERR_INVALIDCALL) [Re: jcl] #239521
12/05/08 04:09
12/05/08 04:09
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline OP
Senior Member
Zelek  Offline OP
Senior Member

Joined: Feb 2002
Posts: 357
Florida
I missed that in the manual, thanks. Works now.


Moderated by  HeelX, Spirit 

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