forked from YARC-Official/YARG.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTB2CSharp.h
27 lines (24 loc) · 938 Bytes
/
STB2CSharp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#if defined _WIN32 || defined __CYGWIN__
#ifdef STB_EXPORTS
#ifdef __GNUC__
#define LIB_API(RetType) extern "C" __attribute__ ((dllexport)) RetType
#else
#define LIB_API(RetType) extern "C" __declspec(dllexport) RetType
#endif
#else
#ifdef __GNUC__
#define LIB_API(RetType) extern "C" __attribute__ ((dllimport)) RetType
#else
#define LIB_API(RetType) extern "C" __declspec(dllimport) RetType
#endif
#endif
#elif __GNUC__ >= 4
#define LIB_API(RetType) extern "C" __attribute__ ((visibility ("default"))) RetType
#else
#define LIB_API(RetType) extern "C" RetType
#endif
LIB_API(unsigned char*) load_image_from_memory(const unsigned char* bytes, int length, int* width, int* height, int* components);
LIB_API(void) free_image(unsigned char* image);