Lavos Posted April 24, 2013 Author Share Posted April 24, 2013 Okay I did my code like so:```Public WIREMODE As Boolean``````Public Function Init_Render_States()WIREMODE = Not WIREMODE'Setup render statesWith Nemo .Set_EngineCullMode D3DCULL_NONE .Set_EngineRenderState D3DRS_SRCBLEND, D3DBLEND_SRCALPHA .Set_EngineRenderState D3DRS_LIGHTING, True .Set_EngineRenderState D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA .Set_EngineRenderState D3DRS_ALPHABLENDENABLE, False If WIREMODE Then .Set_EngineRenderState D3DRS_FILLMODE, D3DFILL_WIREFRAME Else .Set_EngineRenderState D3DRS_FILLMODE, D3DFILL_SOLID End If .Set_EngineRenderState D3DRS_ZENABLE, False .Set_EngineRenderState D3DRS_ZWRITEENABLE, False .Set_EngineRenderState D3DRS_POINTSPRITE_ENABLE, 1 .Set_EngineRenderState D3DRS_POINTSCALE_ENABLE, 0 .Set_EngineAlphaBlendingOp D3DBLENDOP_ADD .Set_EngineSpecularEnable FalseEnd WithEnd Function```Under frmMapEditor i have this:```Private Sub chkWireMode_Click()If chkWireMode.value Then WIREMODE = TrueElse WIREMODE = FalseEnd IfEnd Sub```With the check box on the form, i wanted to toggle renderstates using the chkbox, but it doesn't seem to update, I thought maybe adding:```If WIREMODE Then .Set_EngineRenderState D3DRS_FILLMODE, D3DFILL_WIREFRAME Else .Set_EngineRenderState D3DRS_FILLMODE, D3DFILL_SOLID End If```into the gameloop might work, but it froze and crashed the compiler. Any ideas on how to get around this? Link to comment Share on other sites More sharing options...
Stach Posted April 24, 2013 Share Posted April 24, 2013 Remove 'WIREMODE = Not WIREMODE' from your '[background=rgb(248, 248, 248)]Init_Render_States[/background][background=rgb(248, 248, 248)]' [/background]function. Then once the check box is checked, set WIREMODE is true and just reload Init_Render_States.```Private Sub chkWireMode_Click() WIREMODE = chkWireMode.Value Call Init_Render_StatesEnd Sub``` Link to comment Share on other sites More sharing options...
Lavos Posted April 24, 2013 Author Share Posted April 24, 2013 looks like it worked like a charm. thanks yet again tael Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now