Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / a small question about sprites , please respond

Author
Message
haliop
User Banned
Posted: 26th Jun 2013 15:35
if for say i'll add
100 sprites to a random place in screen... using the DrawSprite command , where the original sprite is offscreen or hidden..

and i use EnableClearColor(0)
so actually all im doing is just DrawSprite to diffrent locations on screen...

how come if i donot clean the screen...
how come the getManagedSpriteDrawCalls keep increasing and no stay steady at 100 as the number of the sprites i draw each frame..

it feels like i made a mistake somewhere however it might be a bug or this is just how AppGameKit works... i think the problem is on my end..
any thoughts?

like if i draw 100 sprites per frame
then the managedSpriteDrawCalls should be 100
cause if i'll enableClearColor(1) then you will see only 100 sprites per frame...
but when its off its 100 + 100 + 100 + 100 and so on.. which should not happen...

Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 26th Jun 2013 15:45
Maybe it's just never clearing the sprite buffer, so each time you call a DrawSprite, it's adding to the buffer but never clearing it. Drawing the sprite won't actually draw it in 2D, it'll add it to the render pipeline which should really be cleared after each sync().

Are you disabling automatic screen updates?, maybe you'll have to clear the buffer yourself somehow.

I got a fever, and the only prescription, is more memes.
haliop
User Banned
Posted: 26th Jun 2013 15:47
how do i reach this buffer?
what are we talking about in sense of commands?

cause i use EnableClearColor(0)
and EnableClearDepth(0)

haliop
User Banned
Posted: 26th Jun 2013 15:48
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Jun 2013 17:59
The general idea is you use:
1- clearScreen() to clear the buffer
2- drawSprite() / render() to draw / paste your sprites
3- swap() to swap the buffer to the screen


this.mess = abs(sin(times#))
haliop
User Banned
Posted: 27th Jun 2013 01:27
incredible!
ok and how would i continue the get updates from the core system like Pointer , time , etc ? dont i need sync?

haliop
User Banned
Posted: 27th Jun 2013 02:41

Login to post a reply

Server time is: 2024-05-03 20:58:07
Your offset time is: 2024-05-03 20:58:07