Add FreeType, progress to title screen

This commit is contained in:
elasota
2019-12-21 18:40:17 -05:00
parent c9c6976344
commit 8354d13a84
901 changed files with 444265 additions and 440 deletions

View File

@@ -1,13 +1,13 @@
#pragma once
#include "EGpAudioDriverType.h"
class IGpAudioDriver;
struct GpAudioDriverProperties
{
#pragma once
#include "EGpAudioDriverType.h"
struct IGpAudioDriver;
struct GpAudioDriverProperties
{
EGpAudioDriverType m_type;
unsigned int m_sampleRate;
bool m_debug;
};
bool m_debug;
};

View File

@@ -1,26 +1,30 @@
#pragma once
#include "EGpDisplayDriverType.h"
class IGpDisplayDriver;
class GpFiber;
struct GpDisplayDriverProperties
{
typedef void(*TickFunc_t)(void *context, GpFiber *vosFiber);
EGpDisplayDriverType m_type;
unsigned int m_frameTimeLockNumerator;
unsigned int m_frameTimeLockDenominator;
unsigned int m_frameTimeLockMinNumerator;
unsigned int m_frameTimeLockMinDenominator;
unsigned int m_frameTimeLockMaxNumerator;
unsigned int m_frameTimeLockMaxDenominator;
// Tick function and context to call when a frame needs to be served.
TickFunc_t m_tickFunc;
void *m_tickFuncContext;
};
#pragma once
#include "EGpDisplayDriverType.h"
struct IGpDisplayDriver;
class GpFiber;
struct GpDisplayDriverProperties
{
typedef void(*TickFunc_t)(void *context, GpFiber *vosFiber);
typedef void(*RenderFunc_t)(void *context);
EGpDisplayDriverType m_type;
unsigned int m_frameTimeLockNumerator;
unsigned int m_frameTimeLockDenominator;
unsigned int m_frameTimeLockMinNumerator;
unsigned int m_frameTimeLockMinDenominator;
unsigned int m_frameTimeLockMaxNumerator;
unsigned int m_frameTimeLockMaxDenominator;
// Tick function and context to call when a frame needs to be served.
TickFunc_t m_tickFunc;
void *m_tickFuncContext;
RenderFunc_t m_renderFunc;
void *m_renderFuncContext;
};

89
GpCommon/GpVOSEvent.h Normal file
View File

@@ -0,0 +1,89 @@
#pragma once
namespace GpKeyIDSubsets
{
enum GpKeyIDSubset
{
kASCII,
kSpecial,
kNumPadASCII,
kNumPadSpecial,
kFKey, // Key value is a raw F number
};
}
typedef GpKeyIDSubsets::GpKeyIDSubset GpKeyIDSubset_t;
namespace GpKeySpecials
{
enum GpKeySpecial
{
kEscape,
kPrintScreen,
kScrollLock,
kPause,
kInsert,
kHome,
kPageUp,
kPageDown,
kDelete,
kEnd,
kBackspace,
kCapsLock,
kEnter,
kLeftShift,
kRightShift,
kLeftCtrl,
kRightCtrl,
kLeftAlt,
kRightAlt,
kNumLock,
};
}
typedef GpKeySpecials::GpKeySpecial GpKeySpecial_t;
namespace GpInputEventTypes
{
enum GpInputEventType
{
kDown,
kUp,
kAuto,
};
}
typedef GpInputEventTypes::GpInputEventType GpInputEventType_t;
namespace GpVOSEventTypes
{
enum GpVOSEventType
{
kInput,
};
}
typedef GpVOSEventTypes::GpVOSEventType GpVOSEventType_t;
struct GpInputEvent
{
union KeyUnion
{
GpKeySpecials::GpKeySpecial m_specialKey;
char m_asciiChar;
};
GpInputEventType_t m_eventType;
GpKeyIDSubset_t m_keyIDSubset;
KeyUnion m_key;
};
struct GpVOSEvent
{
union EventUnion
{
GpInputEvent m_inputEvent;
};
GpVOSEventType_t m_eventType;
};

View File

@@ -14,3 +14,5 @@ struct GPWindowsGlobals
};
extern GPWindowsGlobals g_gpWindowsGlobals;
#undef CreateMutex

View File

View File

@@ -2,12 +2,10 @@
struct IGpAudioChannel;
class IGpAudioDriver
{
public:
virtual ~IGpAudioDriver() {}
struct IGpAudioDriver
{
public:
virtual IGpAudioChannel *CreateChannel() = 0;
virtual IGpAudioChannel *CreateChannel() = 0;
virtual void Shutdown() = 0;
};
virtual void Shutdown() = 0;
};

View File

@@ -1,15 +1,20 @@
#pragma once
#include "PixelFormat.h"
// Display drivers are responsible for timing and calling the game tick function.
class IGpDisplayDriver
{
public:
virtual ~IGpDisplayDriver() {}
virtual void Run() = 0;
virtual void Shutdown() = 0;
virtual void GetDisplayResolution(unsigned int *width, unsigned int *height, PortabilityLayer::PixelFormat *bpp) = 0;
};
#include "PixelFormat.h"
struct IGpDisplayDriverSurface;
// Display drivers are responsible for timing and calling the game tick function.
struct IGpDisplayDriver
{
public:
virtual void Run() = 0;
virtual void Shutdown() = 0;
virtual void GetDisplayResolution(unsigned int *width, unsigned int *height, PortabilityLayer::PixelFormat *bpp) = 0;
virtual IGpDisplayDriverSurface *CreateSurface(size_t width, size_t height, PortabilityLayer::PixelFormat pixelFormat) = 0;
virtual void DrawSurface(IGpDisplayDriverSurface *surface, size_t x, size_t y, size_t width, size_t height) = 0;
virtual void UpdatePalette(const void *paletteData) = 0;
};

View File

@@ -0,0 +1,8 @@
#pragma once
struct IGpDisplayDriverSurface
{
virtual void Upload(const void *data, size_t x, size_t y, size_t width, size_t height, size_t pitch) = 0;
virtual void UploadEntire(const void *data, size_t pitch) = 0;
virtual void Destroy() = 0;
};