xxx
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
|
modules/
|
||||||
.sx-cache
|
.sx-cache
|
||||||
4
main.sx
4
main.sx
@@ -9,8 +9,8 @@ WIDTH :f32: 800;
|
|||||||
HEIGHT :f32: 600;
|
HEIGHT :f32: 600;
|
||||||
|
|
||||||
save_snapshot :: (path: [:0]u8, w: s32, h: s32) {
|
save_snapshot :: (path: [:0]u8, w: s32, h: s32) {
|
||||||
stride : s64 = xx (w * 4);
|
stride : s64 = w * 4;
|
||||||
buf_size : s64 = stride * xx h;
|
buf_size : s64 = stride * h;
|
||||||
pixels : [*]u8 = xx context.allocator.alloc(buf_size);
|
pixels : [*]u8 = xx context.allocator.alloc(buf_size);
|
||||||
glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user