mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
More work. Audio driver works enough to play music now.
This commit is contained in:
8
GpCommon/EGpAudioDriverType.h
Normal file
8
GpCommon/EGpAudioDriverType.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
enum EGpAudioDriverType
|
||||
{
|
||||
EGpAudioDriverType_XAudio2,
|
||||
|
||||
EGpAudioDriverType_Count,
|
||||
};
|
8
GpCommon/EGpDisplayDriverType.h
Normal file
8
GpCommon/EGpDisplayDriverType.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
enum EGpDisplayDriverType
|
||||
{
|
||||
EGpDisplayDriverType_D3D11,
|
||||
|
||||
EGpDisplayDriverType_Count,
|
||||
};
|
13
GpCommon/GpAudioDriverProperties.h
Normal file
13
GpCommon/GpAudioDriverProperties.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "EGpAudioDriverType.h"
|
||||
|
||||
class IGpAudioDriver;
|
||||
|
||||
struct GpAudioDriverProperties
|
||||
{
|
||||
EGpAudioDriverType m_type;
|
||||
|
||||
unsigned int m_sampleRate;
|
||||
bool m_debug;
|
||||
};
|
25
GpCommon/GpCoreDefs.h
Normal file
25
GpCommon/GpCoreDefs.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#if __cplusplus >= 199711L
|
||||
#define GP_IS_CPP11 1
|
||||
#else
|
||||
#define GP_IS_CPP11 0
|
||||
#endif
|
||||
|
||||
#if GP_IS_CPP11
|
||||
#define GP_DELETED = delete
|
||||
#else
|
||||
#ifndef nullptr
|
||||
#define nullptr 0
|
||||
#endif
|
||||
|
||||
#ifndef override
|
||||
#define override
|
||||
#endif
|
||||
|
||||
#ifndef final
|
||||
#define final
|
||||
#endif
|
||||
|
||||
#define GP_DELETED
|
||||
#endif
|
26
GpCommon/GpDisplayDriverProperties.h
Normal file
26
GpCommon/GpDisplayDriverProperties.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;
|
||||
};
|
16
GpCommon/GpWindows.h
Normal file
16
GpCommon/GpWindows.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#define NOMINMAX
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
struct GPWindowsGlobals
|
||||
{
|
||||
HINSTANCE m_hInstance;
|
||||
HINSTANCE m_hPrevInstance;
|
||||
LPSTR m_cmdLine;
|
||||
int m_nCmdShow;
|
||||
};
|
||||
|
||||
extern GPWindowsGlobals g_gpWindowsGlobals;
|
10
GpCommon/IGpAudioChannel.h
Normal file
10
GpCommon/IGpAudioChannel.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
struct IGpAudioChannelCallbacks;
|
||||
|
||||
struct IGpAudioChannel
|
||||
{
|
||||
virtual void SetAudioChannelContext(IGpAudioChannelCallbacks *callbacks) = 0;
|
||||
virtual void PostBuffer(const void *buffer, size_t bufferSize) = 0;
|
||||
virtual void Destroy() = 0;
|
||||
};
|
6
GpCommon/IGpAudioChannelCallbacks.h
Normal file
6
GpCommon/IGpAudioChannelCallbacks.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
struct IGpAudioChannelCallbacks
|
||||
{
|
||||
virtual void NotifyBufferFinished() = 0;
|
||||
};
|
13
GpCommon/IGpAudioDriver.h
Normal file
13
GpCommon/IGpAudioDriver.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
struct IGpAudioChannel;
|
||||
|
||||
class IGpAudioDriver
|
||||
{
|
||||
public:
|
||||
virtual ~IGpAudioDriver() {}
|
||||
|
||||
virtual IGpAudioChannel *CreateChannel() = 0;
|
||||
|
||||
virtual void Shutdown() = 0;
|
||||
};
|
15
GpCommon/IGpDisplayDriver.h
Normal file
15
GpCommon/IGpDisplayDriver.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#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;
|
||||
};
|
Reference in New Issue
Block a user