class MegaBadDesign{public: // Z Buffer void ToggleZBuffer(bool toggle); void SetZBufferRes(float res); void SetZBufferDepth(float depth); void InvertZBuffer(); void FlipZBuffer(); // Stencil void ToggleStencil(bool toggle); void SetStencilMask(int value); void InvertStencil(); void FlipStencil(); // Techniques void StartTech(HANDLE tech); void StopTech(); void LockTech(); void UnlockTech(); bool CheckTech(HANDLE tech); // Lighting void SetLightDir(int index, const vector &dir); void SetLightAmp(int index, FLOAT amp); void SetLightColor(int index, color value); void SetShaderDir(int index, const vector &dir); void SetShaderAmp(int index, FLOAT amp); void SetShaderColor(int index, color value); // Streams void SetStream(stream *s); bool CheckStream(const stream *s);private: APIShaderObject m_Thing;};
This is still just a taste, but hopefully it's pointing in the right direction. My opinion, this would be a cleaner way to name the z buffer section:
... // Z Buffer void ZBuffer_Toggle(bool toggle); void ZBuffer_SetRes(float res); void ZBuffer_SetDepth(float depth); void ZBuffer_Invert(); void ZBuffer_Flip();...
As you can see, this class just needs to manipulate the APIShaderObject interface, and perhaps do some error checking or logging. There's just a lot of functions dealing with a small amount of data.
As an example of how prefixing can help organize a mass of interface functions, let's look at the IDirect3DDevice9 interface..
BeginSceneBeginStateBlockClearColorFillCreateAdditionalSwapChainCreateCubeTextureCreateDepthStencilSurfaceCreateIndexBufferCreateOffscreenPlainSurfaceCreatePixelShaderCreateQueryCreateRenderTargetCreateStateBlockCreateTextureCreateVertexBufferCreateVertexDeclarationCreateVertexShaderCreateVolumeTextureDeletePatchDrawIndexedPrimitiveDrawIndexedPrimitiveUPDrawPrimitiveDrawPrimitiveUPDrawRectPatchDrawTriPatchEndSceneEndStateBlockEvictManagedResourcesGetAvailableTextureMemGetBackBufferGetClipPlaneGetClipStatusGetCreationParametersGetCurrentTexturePaletteGetDepthStencilSurfaceGetDeviceCapsGetDirect3DGetDisplayModeGetFrontBufferDataGetFVFGetGammaRampGetIndicesGetLightGetLightEnableGetMaterialGetNPatchModeGetNumberOfSwapChainsGetPaletteEntriesGetPixelShaderGetPixelShaderConstantBGetPixelShaderConstantFGetPixelShaderConstantIGetRasterStatusGetRenderStateGetRenderTargetGetRenderTargetDataGetSamplerStateGetScissorRectGetSoftwareVertexProcessingGetStreamSourceGetStreamSourceFreqGetSwapChainGetTextureGetTextureStageStateGetTransformGetVertexDeclarationGetVertexShaderGetVertexShaderConstantBGetVertexShaderConstantFGetVertexShaderConstantIGetViewportLightEnableMultiplyTransformPresentProcessVerticesResetSetClipPlaneSetClipStatusSetCurrentTexturePaletteSetCursorPositionSetCursorPropertiesSetDepthStencilSurfaceSetDialogBoxModeSetFVFSetGammaRampSetIndicesSetLightSetMaterialSetNPatchModeSetPaletteEntriesSetPixelShaderSetPixelShaderConstantBSetPixelShaderConstantFSetPixelShaderConstantISetRenderStateSetRenderTargetSetSamplerStateSetScissorRectSetSoftwareVertexProcessingSetStreamSourceSetStreamSourceFreqSetTextureSetTextureStageStateSetTransformSetVertexDeclarationSetVertexShaderSetVertexShaderConstantBSetVertexShaderConstantFSetVertexShaderConstantISetViewportShowCursorStretchRectTestCooperativeLevelUpdateSurfaceUpdateTextureValidateDevice
A lot of functions dealing with render states. Quite a few pixel shaders, and vertex shaders. Stream sources, textures, and specific buffers. Good luck trying to sort it out as you code. You need a reference for this.
I also do not like jumping to header files every time I need to access a specific object or perform a specific task. I just like to use the IDE tools to speed the process up. With this type of setup, that's not even a question to be considered.