Gamestudio Links
Zorro Links
Newest Posts
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
ZorroGPT
by TipmyPip. 04/08/26 17:08
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Grant, Volkovstudio), 5,450 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Geir, ondrej, mredit, vestriaa, Lukudo
19206 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,093
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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