GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
alloc_surface(3) Arcan Lua API alloc_surface(3)

alloc_surface - Create an empty, non-visible surface with a preset storage.

vid
alloc_surface( int:width, int:height )
alloc_surface( int:width, int:height, bool:noalpha )
alloc_surface( int:width, int:height, bool:noalpha, int:quality )

Some operations, particularly record and rendertargets need a storage buffer to work with. While fill_surface could also be used for such operations, this function will result in one one less transfer and, optionally, some control over storage format and quality. If noalpha is set (true, !0) the texture format for the underlying backing store will be set to one where the alpha channel corresponds to fullbright (ignore/nobright). quality can be set to one of the following: ALLOC_QUALITY_LOW , ALLOC_QUALITY_NORMAL , ALLOC_QUALITY_HIGH , ALLOC_QUALITY_FLOAT 16, ALLOC_QUALITY_FLOAT 32.

1
Only ALLOC_QUALITY_NORMAL is guaranteed to be a valid target for

map_video_display and similar operations.

2
Note that not all storage modes will support all forms of filtering, or mipmapping. If in doubt, disable vfilter and manually sample in a shader.

function alloc_surface0()
      local vid = fill_surface(640, 480);
      assert(vid ~= BADID)
      print("allocated: ", vid, 640, 480);
      show_image(vid);
end

function alloc_surface0()
      fill_surface(-1, -1);
end

function alloc_surface1()
      fill_surface(1000000, 100000000);
end

June 2022 image

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.