added main menus, improved shading
This commit is contained in:
34
public/interface.h
Normal file
34
public/interface.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef INTERFACE_H
|
||||
#define INTERFACE_H
|
||||
|
||||
#include "tier0/platform.h"
|
||||
|
||||
abstract_class IInterface
|
||||
{
|
||||
public:
|
||||
virtual void Init() = 0;
|
||||
virtual void Frame() = 0;
|
||||
virtual void Deinit() = 0;
|
||||
};
|
||||
|
||||
typedef IInterface*( *InterfaceRegistryFn )( void );
|
||||
|
||||
class CInterfaceRegistry
|
||||
{
|
||||
public:
|
||||
CInterfaceRegistry( const char *szName, InterfaceRegistryFn pfn );
|
||||
};
|
||||
|
||||
|
||||
#define DECLARE_INTERFACE(iface, impl) \
|
||||
IInterface *__interface_alloc_##impl() \
|
||||
{ \
|
||||
return new impl; \
|
||||
}; \
|
||||
CInterfaceRegistry __interface_##name##_registry(#iface, __interface_alloc_##impl); \
|
||||
I##iface *iface() { \
|
||||
static I##iface *pInterface = (I##iface*)__interface_alloc_##impl(); \
|
||||
return pInterface; \
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user