PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

SetRenderTarget

I've just installed the latest pre-release and am converting some code to match the changes:

SetSurface -> SetRenderTarget

I'm getting an error:
Invalid number of parameters at 'SETRENDERTARGET'

According to the chm this func takes 3 parameters. That's what I'm giving it. I believe I have to replace use of 'NULL' with a new special var: buffer%. I've done this too and am still getting the error.

Any ideas?

Must I assign the return value?

I'll try that and let u know...
Sorry it's only one parameter, the buffer% variable in fact. I will update the help file right now.

Code:
old$ = SetRenderTarget(mysurface$);
// Do some stuff
SetRenderTarget(old$);
How do we SetRenderTarget to the screen? It used to be NULL. I've tried that and 0 and -1 and (). Am I missing the point? :?
When you initialize the game api, PPL sets the global variable BUFFER% with the main screen buffer pointer. Instead of using NULL, use BUFFER%. It's that simple! :)
I've done as you suggested and the app gets a little further. The gameapi inits (the screen goes black for a fraction of a sec) then I get the following message:

Proc: (null)
Opcode: SETRENDERTARGET
Char/Line: 0/0

(MAIN)
Address misaligned at 0x4f468

I'm having some difficulty finding line 0, char 0 to debug this. My brain throws an exception when I try to assign line=0 :oops:

Is there anything else we should know about SETRENDERTARGET?

Would you like me to PM you the source?
Oups, sorry you are still using the old version, I have the latest, my bad, sorry! :cry:

Wait for the newest version, which I will release later today, there was a problem with the setrendertarget that has been fixed.
Great! my app starts up again now! I have another problem now. I believe the wParam and lParam in the mainproc have changed for supplying x and y of stylus tap. They now supply one each of the co-ords right?
Ive changed my code but it doesn't seem to be responding to the WM_LBUTTONDOWN msg. I cant test one of the gameapi demos as they now seem to be incompatible with current ver...
Its a hard life being a beta tester...
but im still glad im involved!
Are you sure you are running the latest .exe? All demos works fine here. wParam$ is now the X and lParam$ is the Y value of the stylus location.

Show me the piece of code that is not working, maybe I can help you.
I've just uninstalled and reinstalled.
The 'Simple2' does not compile anymore.

However, the isodemo (very very nice!) works fine. It also uses the new wParam$, lParam$ so I'm going to spend a bit longer trying to work out why mine doesn't work....
Initial findings...

The mainproc routine is not being executed.

I put a G_showmessage into the start of the routine and it made no difference. The same message in the same place on the isodemo, flickered a few times and crashed PPL (I'm not worried about that, I know its an odd place to put a message - I'm just demonstrating that the mainproc is not being executed.)

I've looked at the InitGameAPI call in winmain and it was different to the one in isodemo (you seem to be handling this difference in the gameapi lib)

I tried making it the same as isodemo but that didn't make any difference.

Shall I PM you the code?
Make sure the simple2.ppc is deleted first.

Also, I forgot to fix the Simple2.ppl and Simple2_1.ppl files. The Sprites() function now takes two parameters. But the fonction is now broken, I will take a look and try to come up with a fix today.