Garry's Mod Wiki

Garry's Mod Wiki

  boolean GM:PreRender()

Description

Called before the renderer is about to start rendering the next frame.

Returns

1 boolean
Return true to prevent all rendering. This can make the whole game stop rendering anything.

Example

Fills the draw buffer with black pixels, removing tearing when looking at a world leak. Achieves the same effect as using gl_clear. This is no longer needed as GMod does this by default.

hook.Add("PreRender", "ResetBuffer", function() cam.Start2D() surface.SetDrawColor(0, 0, 0, 255) surface.DrawRect(0, 0, ScrW(), ScrH()) cam.End2D() end)

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...