networking
This commit is contained in:
1
public/fgui/button.h
Normal file
1
public/fgui/button.h
Normal file
@@ -0,0 +1 @@
|
||||
#include "widget.h"
|
||||
@@ -1,27 +1,43 @@
|
||||
#ifndef FGUI_H
|
||||
#define FGUI_H
|
||||
|
||||
#include "rendering.h"
|
||||
#include "tier0/platform.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
abstract_class fgui
|
||||
class CFGUI_Widget;
|
||||
|
||||
struct FGUI_Event_t
|
||||
{
|
||||
struct Color_t
|
||||
{
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
};
|
||||
|
||||
/* every position is resized to some degree of 1280x720 */
|
||||
struct Vector_t
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
static void Init( void );
|
||||
static void Frame( void );
|
||||
static void Rectangle( Vector_t posPx, Vector_t posFl, Vector_t sizePx, Vector_t sizeFl );
|
||||
static void Text( const char *psz, uint32_t nSize, Vector_t pos, Vector_t color );
|
||||
};
|
||||
|
||||
#endif
|
||||
class CFont
|
||||
{
|
||||
public:
|
||||
CUtlString szName;
|
||||
ITexture *pTexture;
|
||||
uint32_t glyphWidth;
|
||||
uint32_t glyphHeight;
|
||||
char cCharacterSet[256];
|
||||
};
|
||||
|
||||
interface IFGUI
|
||||
{
|
||||
public:
|
||||
static void Init( void );
|
||||
static void Frame( void );
|
||||
static void AppendWidget( CFGUI_Widget *pWidget );
|
||||
static void DestroyWidget( CFGUI_Widget *pWidget );
|
||||
|
||||
static void SetRectColor( float r, float g, float b, float a );
|
||||
static void DrawRect( int32_t iPosX, int32_t iPosY, uint32_t uSizeX, uint32_t uSizeY );
|
||||
|
||||
static CFont *LoadFont( CUtlString szFontPath );
|
||||
static void SetTextFont( CFont *pFont );
|
||||
static void SetTextPos( float x, float y );
|
||||
static void SetTextColor( float r, float g, float b, float a );
|
||||
static void DrawText( CUtlString psz );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
26
public/fgui/label.h
Normal file
26
public/fgui/label.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef FGUI_LABEL_H
|
||||
#define FGUI_LABEL_H
|
||||
#include "widget.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "rendering.h"
|
||||
|
||||
class CFGUI_Label: public CFGUI_Widget
|
||||
{
|
||||
public:
|
||||
CFGUI_Label();
|
||||
~CFGUI_Label();
|
||||
|
||||
CUtlString m_szText;
|
||||
float m_fLabelColor[3];
|
||||
|
||||
void SetFont( CUtlString font );
|
||||
void SetLabel( CUtlString text );
|
||||
void SetLabelSize( uint32_t nSize );
|
||||
|
||||
virtual void Event( FGUI_Event_t event ) override;
|
||||
virtual void Draw() override;
|
||||
|
||||
uint32_t m_fGlyphSize[2];
|
||||
};
|
||||
|
||||
#endif
|
||||
28
public/fgui/widget.h
Normal file
28
public/fgui/widget.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef FGUI_WIDGET_H
|
||||
#define FGUI_WIDGET_H
|
||||
|
||||
#include "tier0/platform.h"
|
||||
#include "fgui.h"
|
||||
|
||||
class CFGUI_Widget
|
||||
{
|
||||
public:
|
||||
CFGUI_Widget();
|
||||
CFGUI_Widget(CFGUI_Widget *pParent);
|
||||
~CFGUI_Widget();
|
||||
|
||||
void SetPosition( int32_t nX, int32_t nY );
|
||||
void SetSize( uint32_t nX, uint32_t nY );
|
||||
void SetParent( CFGUI_Widget *pParent );
|
||||
|
||||
virtual void Event( FGUI_Event_t event ) = 0;
|
||||
virtual void Draw() = 0;
|
||||
|
||||
static void SetDefaultParent(CFGUI_Widget *pParent);
|
||||
|
||||
int32_t m_iPosition[2];
|
||||
uint32_t m_iSize[2];
|
||||
CFGUI_Widget *m_pParent;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user