Contains the public functions
This commit is contained in:
parent
bdc066a188
commit
7a6ce0d91e
|
@ -0,0 +1,51 @@
|
||||||
|
//**************************************************************
|
||||||
|
//* MacGLide - Glide to OpenGL Wrapper
|
||||||
|
//* http://macglide.sourceforge.net/
|
||||||
|
//*
|
||||||
|
//* Shared Library entry points
|
||||||
|
//*
|
||||||
|
//* MacGLideTexturesPlugin is OpenSource under LGPL license
|
||||||
|
//* Originally made by Jens-Olaf Hemprich
|
||||||
|
//**************************************************************
|
||||||
|
|
||||||
|
#include "TexturesPlugin.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void(*glide_message)(const char *message, ...);
|
||||||
|
void(*glide_error)(const char *message, ...);
|
||||||
|
|
||||||
|
void setMsgFunction(void(*function)(const char *message, ...))
|
||||||
|
{
|
||||||
|
glide_message = function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setErrorFunction(void(*function)(const char *message, ...))
|
||||||
|
{
|
||||||
|
glide_error = function;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GlideMsg(const char* message, ... )
|
||||||
|
{
|
||||||
|
if (glide_message)
|
||||||
|
{
|
||||||
|
va_list(args);
|
||||||
|
va_start(args, message);
|
||||||
|
char buffer[StringBufferSize];
|
||||||
|
vsnprintf(buffer, StringBufferSize, message, args);
|
||||||
|
(*glide_message)(&buffer[0]);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GlideError(const char *message, ... )
|
||||||
|
{
|
||||||
|
if (glide_error)
|
||||||
|
{
|
||||||
|
va_list(args);
|
||||||
|
va_start(args, message);
|
||||||
|
char buffer[StringBufferSize];
|
||||||
|
vsnprintf(buffer, StringBufferSize, message, args);
|
||||||
|
(*glide_error)(&buffer[0]);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
//**************************************************************
|
||||||
|
//* MacGLide - Glide to OpenGL Wrapper
|
||||||
|
//* http://macglide.sourceforge.net/
|
||||||
|
//*
|
||||||
|
//* Shared Library entry points
|
||||||
|
//*
|
||||||
|
//* MacGLideTexturesPlugin is OpenSource under LGPL license
|
||||||
|
//* Originally made by Jens-Olaf Hemprich
|
||||||
|
//**************************************************************
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// size of temporary buffers for string processing
|
||||||
|
const int StringBufferSize = 256;
|
||||||
|
|
||||||
|
// library entry points
|
||||||
|
#pragma export on
|
||||||
|
extern "C" void setMsgFunction(void(*function)(const char *message, ...));
|
||||||
|
extern "C" void setErrorFunction(void(*function)(const char *message, ...));
|
||||||
|
#pragma export off
|
||||||
|
|
||||||
|
// Let's have the same interface for logging
|
||||||
|
void GlideMsg(const char *message, ...);
|
||||||
|
void GlideError(const char *message, ...);
|
Loading…
Reference in New Issue