Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
What's the buffer doing with the surface? [Code Included]
Post Flair (click to view more posts with a particular flair)
Author Summary
numaru1989 is in Code Included
Post Body

Am I doing this right? It works, but is it right?

Create:

var _surf_width = 918;

var _surf_height = 544;

draw_layer_surface = surface_create(_surf_width,_surf_height);

draw_layer_buffer = buffer_create(_surf_width * _surf_height * 4, buffer_fixed, 1);

buffer_get_surface(draw_layer_buffer, draw_layer_surface, 0);

Draw:

if not surface_exists(draw_layer_surface_textbox)

`{`

`var _surf_width = 918;`

`var _surf_height = 544;`

`draw_layer_surface = surface_create(_surf_width,_surf_height);`

`draw_layer_buffer = buffer_create(_surf_width * _surf_height * 4, buffer_fixed, 1);`

`buffer_get_surface(draw_layer_buffer, draw_layer_surface, 0);`

`}`

End Game:

surface_free(draw_layer_surface);

buffer_delete(draw_layer_buffer);

My reason for questioning this despite it working is that I figured that using the buffer would keep my surface from deleting, but going full screen, changing resolution, and almost anything deletes it. Since it doesn't free the buffer data when reassigning the surface and buffer, wouldn't that eventually eat computer resources or does that call the same buffer to the new surface. What does the buffer even do - I guess is my ultimate question here? I feel,, I might be wrong in this. I just want to get another's view on this.

Author
Account Strength
80%
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,403
Link Karma
159
Comment Karma
1,203
Profile updated: 5 days ago
Posts updated: 2 weeks ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago