English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 July 2010, 10:48   #1
Sonic
 
Posts: n/a
Exclamation Some question about graphics.library lowlevels

Hello!

I tried to ask these question at utilitybase.com, however noone knows the answer there. I hope this is the better place to ask them, i see there are some oldschool demo coders here with lowlevel stuff knowledge. Perhaps someone knows answers...

1. What is actually DrawInfo.dri_Resolution? In what units is it expressed? Comment in OS3.9 NDK says that is's a copy of DisplayInfo data for screen's display mode.
I guess it's taken from DisplayInfo.Resolution. Well, again, what is it? Comment is short: "ticks-per-pixel X/Y". What is tick then?

2. About sprites, when used by graphics.library. If i want to completely remove my sprite from the screen, before FreeSprite() or FreeSpriteData(), what should i do? I beleive if i just call FreeSpriteData() the hardware will still be directed to display deallocated sprite image, which will then be trashed? So what function does the job of actual sprite removal? FreeSprite() FreeSpriteData()? Should i do it manually somehow?

I am working graphics.library on AROS operating system and i am implementing some missing parts. The answers are needed in order to do this correctly.
 
Old 26 July 2010, 12:28   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,539
"tick": http://eab.abime.net/showthread.php?t=53132
Toni Wilen is offline  
Old 27 July 2010, 09:21   #3
Sonic
 
Posts: n/a
Thanks. This little investigation gives me some ideas.
I also know that this information is used by BOOPSI gadgets to render themselves. I guess relation of these two numbers shows how square the pixel is.
 
Old 28 July 2010, 11:45   #4
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,642
Quote:
Originally Posted by Sonic View Post
2. About sprites, when used by graphics.library. If i want to completely remove my sprite from the screen, before FreeSprite() or FreeSpriteData(), what should i do? I beleive if i just call FreeSpriteData() the hardware will still be directed to display deallocated sprite image, which will then be trashed? So what function does the job of actual sprite removal? FreeSprite() FreeSpriteData()? Should i do it manually somehow?
Define "actual sprite removal"...

FreeSprite frees 1 of the 8 hardware sprites that you reserved for use with GetSprite for your Viewport; returns it to be used by the OS (or another program that needs to use a sprite).

FreeSpriteData should free the memory containing the sprite structure data - sprite's pixeldata etc.

So I guess you GetSpriteData and copy spritegraphics into it at your program init, then when you need to move them around or show them you ask the OS to use some sprites with GetSprite; when they don't need to be seen anymore you FreeSprite and when you don't need the spritegraphics anymore you FreeSpriteData. Don't take my word as the law; no manuals here where I am.

Do you have a manual like Libraries & Devices and an Amiga setup where you can try out how things are meant to work? Then you would get a good feel of what differs between sprites and Vsprites, blitlists with bobs etc., and get to know some of the hard-to-know-without-using details of some functions (like er, I dunno, that FileInfo-structs have to be 8-byte-aligned).

Amiga is special in that its OS is more closely adapted to how the hardware works than other OSes (less abstracted from hw). For example, I would guess that by modifying the SpriteData, you can actually re-use the GetSprite "sprite channel 0-7" just as you do with hardware programming; if that's true and you don't support it because you think sprites are "normal sprite" implementations, then programs using that feature will not work.
Photon is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open-source graphics library Don_Adan Coders. System 32 15 January 2013 22:15
Simple chunky 2D Graphics Library needed in C NovaCoder Coders. General 4 19 December 2011 12:39
graphics.library 40.25 beta series Cosmos Coders. General 337 22 July 2011 18:15
graphics.library private LVO's AmiCoder Coders. General 12 30 December 2009 04:24
Can't open version 36 of graphics.library Lambizkit support.Apps 1 07 November 2007 08:00

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


All times are GMT +2. The time now is 00:17.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09666 seconds with 13 queries