PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

What are rasterizers?

1) I noticed in some code that there is a function called NewSurface. In some examples it has three parameters, the last being a rasterizer. What is this?

2) Also, when I put something in this third parameter I get an error saying that I have the wrong amount of parameters. When I just put in two, it gives no errors. How many parameters is NewSurface supposed to have?

Thanks
Hi,

The rasterizer parameters are not needed anymore. The help file hasn't been updated correctly. Here is the new NewSurface() section from the help file.

NEWSURFACE (Width, Height) -> SurfaceHandle

Create a new surface of size (width x height) pixels. The return value is the new surface handle.

To start painting on the surface, use the g_beginscene, when you are finished, use the g_update to update the scene.

To delete the newly created surface use the FreeSurface() function.

Example:

surface$ = NewSurface(100, 100);
os$ = SetRenderTarget(surface$);
g_BeginScene;
g_textout(null, "Test", DVT_NONE, 0, 0, G_RGB(255, 255, 255));
g_Update;
SaveSurface(surface$, "\\My Documents\\Test");
SetRenderTarget(os$);
freesurface (surface$);


Sorry for the delay.