Skip to content

Commit

Permalink
Fixed comments for the constants and added comments to the enums. Als…
Browse files Browse the repository at this point in the history
…o added convenience functions for setting the rendering state.
  • Loading branch information
Lars committed May 6, 2016
1 parent 5431822 commit 3ee927b
Show file tree
Hide file tree
Showing 3 changed files with 2,745 additions and 747 deletions.
36 changes: 36 additions & 0 deletions IDirect3DDevice9_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2505,6 +2505,42 @@ func (obj Device) SetRenderState(
return
}

func (obj Device) SetRenderStateFloat(
State RENDERSTATETYPE,
Value float32,
) (
err Error,
) {
err = toErr(C.IDirect3DDevice9SetRenderState(
obj.handle,
(C.D3DRENDERSTATETYPE)(State),
*((*C.DWORD)(unsafe.Pointer(&Value))),
))
return
}

func (obj Device) SetRenderStateBool(
State RENDERSTATETYPE,
Value bool,
) (
err Error,
) {
if Value {
err = toErr(C.IDirect3DDevice9SetRenderState(
obj.handle,
(C.D3DRENDERSTATETYPE)(State),
1,
))
} else {
err = toErr(C.IDirect3DDevice9SetRenderState(
obj.handle,
(C.D3DRENDERSTATETYPE)(State),
0,
))
}
return
}

// SetRenderTarget sets a new color buffer for the device.
func (obj Device) SetRenderTarget(
RenderTargetIndex uint32,
Expand Down
Loading

0 comments on commit 3ee927b

Please sign in to comment.