A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Looking for a QBlit() or QBSBlit() example in C

 

Author Message
thyslo
Member
#1 - Posted: 16 Oct 2019 08:32
Reply Quote
Hi there,

if anybody has a short C example on the usage of QBlit() or QBSBlit() in C, I'd be glad if it could be posted here.

RKRM Libraries states to these functions: To use QBlit() and QBSBlit(), you must create a data structure called a bltnode (blitter node) that contains a pointer to the blitter code you want to execute.

And now I don't know if this pointer to the blitter code must be a pointer to some asm code or if it coulde be soemthing coded in C.
astrofra
Member
#2 - Posted: 16 Dec 2019 20:02 - Edited
Reply Quote
Hi :)

I searched (maybe not as much as you did) but couldn't find an C sample code of QBlit/QSBlit usage...
It isn't used neither in AROS source code (even if there is some sort of reimplementation of these two functions).

My own guess would be that both could accept a pointer to a C function, as stated by the struct they take as parameter :


/* stuff for blit qeuer */
struct bltnode
{
struct bltnode *n;
int (*function)();
char stat;
short blitsize;
short beamsync;
int (*cleanup)();
};


function is prolly a function pointer, so at a certain point you should have something like :


void my_blit(void)
{
// do my blitting stuff here
}


then, in the same scope :


{
struct bltnode *my_node;
my_node = (struct bltnode *)malloc(sizeof(struct bltnode));
my_node->function = &my_blit;
// ... more init of my_node
// then ...
QSBlit(my_node);
}


/! I have 0% guarantee of the above being correct in any way, however :D

You might want to have a look at Krabob's experiments, here. He seemed to stumble on the same lack of proper documentation, but he found out a way to use QSBlit :)

http://eab.abime.net/showthread.php?t=75065

hope this helps :)
thyslo
Member
#3 - Posted: 14 Feb 2020 08:48
Reply Quote
Thanks for your hints and the link! I'll looking into this:-)
krabob
Member
#4 - Posted: 10 Apr 2020 13:59
Reply Quote
Search in the official "Amiga developer CD 2.1" who as lots of this kind of example. (yet I *never* succeded using blitter with OS calls myself )

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0