Afterwarp Development  

Go Back   Afterwarp Development > Software/Game Development > Announcements
Announcements The discussion about news and announcements posted on our front page.


 
 
Thread Tools Display Modes
  (#1) Old
lifepower lifepower is offline
Developer
lifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud of
 
lifepower's Avatar
 
Posts: 2,072
Join Date: Oct 2005
Location: Pointer = nil;
Asphyre Casual Framework v1.0.5 - 07-Nov-2007, 22:11

A new version of Asphyre Casual Framework has been released. You can read more about it here.
  (#2) Old
Huerefar Huerefar is offline
Professional
Huerefar is on a distinguished road
 
Huerefar's Avatar
 
Posts: 56
Join Date: Jul 2007
12-Nov-2007, 11:54

Do I have to call UseImage every time I want to TexMap something, even with the same settings of UseImage?

This gives me only one good image, and rest is completly white:

Code:
 GameCanvas.UseImagePx(GameImages[imageRoad], pxBounds4(0, 0, 54, 27));
 for x := 0 to 9 do
   for y := 0 to 9 do
     GameCanvas.TexMap(pxBounds4f(50 + 54 * x, 50 + 27 * y, 54, 27), cAlpha4(255));
This works:
Code:
 for x := 0 to 9 do
   for y := 0 to 9 do
     begin
       GameCanvas.UseImagePx(GameImages[imageRoad], pxBounds4(0, 0, 54, 27));
       GameCanvas.TexMap(pxBounds4f(50 + 54 * x, 50 + 27 * y, 54, 27), cAlpha4(255));
     end;
Why first code doesn't work properly and is second code good? I've read that switching textures can be time consuming for GPU.
  (#3) Old
lifepower lifepower is offline
Developer
lifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud oflifepower has much to be proud of
 
lifepower's Avatar
 
Posts: 2,072
Join Date: Oct 2005
Location: Pointer = nil;
12-Nov-2007, 15:29

Quote:
Originally Posted by Huerefar View Post
Do I have to call UseImage every time I want to TexMap something, even with the same settings of UseImage?
Yes, these functions only work in pairs.

Quote:
Originally Posted by Huerefar View Post
Why first code doesn't work properly and is second code good? I've read that switching textures can be time consuming for GPU.
This is exactly why those functions work in pairs. The first one tells the canvas which image will be used, the second one draws it on the screen. If the image and drawing effect haven't changed, they are added to cache (and thus, no texture switching occurs).

Asphyre Canvas is essentially a limited state machine, it saves what texture has been used previously and what effects have been used. These states are saved until the cache is reset (end of rendering, cache full, etc.) Temporal states as the currently used image is only saved until the call to TexMap.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Asphyre Casual Framework lifepower Announcements 28 04-Nov-2007 04:36
Asphyre 3.1 framework Huerefar Published Resources 6 13-Aug-2007 21:54
Resources Asphyre no Fórum sourcecode Asphyre in Portuguese 2 09-Aug-2006 01:24
Getting started with Asphyre - Read First! lifepower Development 0 14-Nov-2005 20:49
Mixing Asphyre eXtreme lifepower Development 4 17-Oct-2005 03:57



vBulletin® is copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com
Copyright (c) 2000 - 2016 Afterwarp Development. All rights reserved.