# SetObjectDepthWrite

## Description

Sets the depth write mode when drawing this object to the screen. If it passes the depth test the object writes its depth value to the depth buffer to stop anything further behind from passing their depth tests. By default only objects that are closer (less than) the current depth value will overwrite the current contents of the screen. You can turn off this writing to the depth buffer for this object, this can be useful for transparent objects that shouldn't block drawing behind themselves. By default all opaque objects have depth write turned on and all transparent objects have depth write turned off.

## Definition

SetObjectDepthWrite( objID, mode )

void agk::SetObjectDepthWrite( UINT objID, int mode )

## Parameters

- objID - The ID of the object to modify.
- mode - 0 to turn depth write off for this object, 1 to turn it on.