Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/20/26 18:18
Ranger by Robert Pardo - now for Zorro
by Smallz. 06/20/26 11:23
Z12 live performance
by jcl. 06/19/26 11:21
Z9 getting Error 058
by jcl. 06/16/26 09:51
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 8,389 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 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: 28,110
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,110
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 | 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