This wiki is out of date, use the continuation of this wiki instead

Blendop new

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:34, 23 July 2007 (edit)
Rincewind (Talk | contribs)
(New article)
← Previous diff
Revision as of 17:42, 23 July 2007 (edit) (undo)
Sandman (Talk | contribs)
m
Next diff →
Line 5: Line 5:
'''INT''' blendop_new() '''INT''' blendop_new()
-Creates a new blending table. This table will contain a blending effect, which you'll have to set after creating the blending table. When that is done you can finally apply the blendop to a graph.+Creates a new blending table. This table will contain a blending effect, which you'll have to set after creating the blending table. When that is done you can finally apply the blendop to a [[graphic]].
- +
-== Parameters ==+
-None.+
== Returns == == Returns ==
-''<If someone knows, please edit!>''+{|
 +| 0 || - Error: insufficient memory
 +|-
 +| !0 || - Success (pointer to the blendop table).
 +|}
== Notes == == Notes ==
-The right order of doing blending stuff: First create a new table with blendop_new(), then put a blending effect in it with for example blendop_tint(), and then assign it to a graph with blendop_assign().+The right order of doing blending stuff: First create a new table with [[blendop_new]](), then put a blending effect in it with for example [[blendop_tint]](), and then assign it to a [[graphic]] with [[blendop_assign]]().
== Errors == == Errors ==
-''<If someone knows, please edit!>''+{|
 +| Insufficient memory || - There is insufficient memory available. This error doesn't occur often.
 +|}
== Example == == Example ==

Revision as of 17:42, 23 July 2007


Contents

Definition

INT blendop_new()

Creates a new blending table. This table will contain a blending effect, which you'll have to set after creating the blending table. When that is done you can finally apply the blendop to a graphic.

Returns

0 - Error: insufficient memory
 !0 - Success (pointer to the blendop table).

Notes

The right order of doing blending stuff: First create a new table with blendop_new(), then put a blending effect in it with for example blendop_tint(), and then assign it to a graphic with blendop_assign().

Errors

Insufficient memory - There is insufficient memory available. This error doesn't occur often.

Example

Program test;
Private
    My_graphic;
    Blending_operation;
Begin
    Set_mode(320,240,16);
    Dump_type = complete_dump;

    x=160;
    y=120;

    My_graphic=new_map(100,100,16);
    Map_clear(0,My_graphic,RGB(255,255,255));

    graph=My_graphic;

    Loop
        If (key(_space))
            Blending_operation=Blendop_new();
            Blendop_tint(Blending_operation,1,255,0,0);
            Blendop_assign(0,My_graphic,Blending_operation);
        End
        Frame;
    End
End

Used in example: set_mode(), new_map(), map_clear(), key(), blendop_tint(), blendop_assign(), dump modes

This will result in something like:

Image:Blendop.jpg

Personal tools