diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-02-19 09:41:46 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-02-19 09:41:46 +0000 |
commit | a55a271f64ecd0b24e8434f3b86a5996c134a394 (patch) | |
tree | 4c211bbce86bb8d3c1a725a0a7eb52df82efd916 /Game/Code/lib/projectM/1.0/cwrapper/projectM.cpp | |
parent | db59da23b2e8f0c347155a91eaf942ca379f98d5 (diff) | |
download | usdx-a55a271f64ecd0b24e8434f3b86a5996c134a394.tar.gz usdx-a55a271f64ecd0b24e8434f3b86a5996c134a394.tar.xz usdx-a55a271f64ecd0b24e8434f3b86a5996c134a394.zip |
A C-Wrapper to make the ProjectM C++-Headers usable in Delphi.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@861 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/lib/projectM/1.0/cwrapper/projectM.cpp')
-rw-r--r-- | Game/Code/lib/projectM/1.0/cwrapper/projectM.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Game/Code/lib/projectM/1.0/cwrapper/projectM.cpp b/Game/Code/lib/projectM/1.0/cwrapper/projectM.cpp new file mode 100644 index 00000000..ff8e2a2f --- /dev/null +++ b/Game/Code/lib/projectM/1.0/cwrapper/projectM.cpp @@ -0,0 +1,69 @@ +#include "projectM.h" + +projectM* projectM_create1(char* config_file) +{ + return new projectM(config_file); +} + +projectM* projectM_create2(int gx, int gy, int fps, int texsize, + int width, int height, char* preset_url, char* title_fonturl, char* title_menuurl) +{ + return new projectM(gx, gy, fps, texsize, width, height, + preset_url, title_fonturl, title_menuurl); +} + +void projectM_resetGL(projectM* pm, int width, int height) +{ + pm->projectM_resetGL(width, height); +} + +void projectM_setTitle(projectM* pm, char* title) +{ + pm->projectM_setTitle(title); +} + +void projectM_renderFrame(projectM* pm) +{ + pm->renderFrame(); +} + +unsigned projectM_initRenderToTexture(projectM* pm) +{ + return pm->initRenderToTexture(); +} + +void projectM_key_handler(projectM* pm, projectMEvent event, + projectMKeycode keycode, projectMModifier modifier) +{ + pm->key_handler(event, keycode, modifier); +} + +void projectM_free(projectM* pm) +{ + delete pm; +} + +void PCM_addPCMfloat(projectM* pm, float *PCMdata, int samples) +{ + pm->pcm->addPCMfloat(PCMdata, samples); +} + +void PCM_addPCM16(projectM* pm, short pcm_data[2][512]) +{ + pm->pcm->addPCM16(pcm_data); +} + +void PCM_addPCM16Data(projectM* pm, const short* pcm_data, short samples) +{ + pm->pcm->addPCM16Data(pcm_data, samples); +} + +void PCM_addPCM8(projectM* pm, unsigned char pcm_data[2][1024]) +{ + pm->pcm->addPCM8(pcm_data); +} + +void PCM_addPCM8_512(projectM* pm, const unsigned char pcm_data[2][512]) +{ + pm->pcm->addPCM8_512(pcm_data); +} |