Hello, people.

Previous topic - Next topic

MrTAToad

Dont see why C++ should be needed.  Never written a paint package unfortunately, so I cant help there.

com_1

Just help me analyze this example, please.
http://www.glbasic.com/showroom.php?site=games&game=Fluids&lang=de

Gernot assembled an excellent example, but it will not run if it is copy and paste it into your project.
Is only what he has compiled.

MrTAToad

Going to take some time - quite a few compiler errors there :(

Kitty Hello

The fluids example is very old code.

Add this at the top of the source:
Code (glbasic) Select

GLOBAL screenx, screeny
LOCAL mx, my,b1,b2
DIM dummy[0][0] // require at least 2D arrays with inline code


You can make this work these days without INLINE, using Polyvector!

com_1

Thanks for help.

With regard to the code (source).
Copied, pasted, by pressing F5 and it worked. (finally)

A question, what do you mean ?
Quote
You can make this work these days without INLINE, using Polyvector!

If I prescribe each point as an array then the computer just hangs.
In this case, such a scheme is not suitable.

scrx = 640; scry = 480;
max = (scrx * scry); dim x[max]; dim y[max];

for d = 0 max - 1;
sepixel x[d], y[d], rgb(250, 250, 250);
next;

Kitty Hello

Why don't you:

-Make a DIM image%[xmax][ymax] // RGBA pixels
-Make a "Sprite" from that image MEM2SPRITE
-Draw that sprite

-> much faster than SETPIXEL.
-> Can zoom

com_1

If I understand correctly that command "MEM2SPRITE()" is a static.
And differs from the command "GRABSPRITE" can not handle real time. (dynamical texture)

I'm looking for a way to handle any object on the screen in real time.

Kitty Hello

You can use MEM2SPRITE on every showscreen. It's quite fast, try it. It's the only way to draw accurate pixels and so.
You could also use CREATESCREEN and draw with DRAWLINE and DRAWRECT - depends on what you need.

com_1

Gernot, wanted to ask.
Someone is helping you in the creation and further development of language, or are you alone ?

Kitty Hello

I have great help others. Especially from Trucidare.