Initial strict HL bindings for passing Image, Rectangle, Bytes
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define LIME_UTILS_ARRAY_BUFFER_VIEW_H
|
||||
|
||||
|
||||
#include <hl.h>
|
||||
#include <hx/CFFI.h>
|
||||
#include <utils/Bytes.h>
|
||||
|
||||
@@ -9,6 +10,19 @@
|
||||
namespace lime {
|
||||
|
||||
|
||||
struct HL_ArrayBufferView {
|
||||
|
||||
hl_type* t;
|
||||
/*TypedArrayType*/ int type;
|
||||
HL_Bytes* buffer;
|
||||
int byteOffset;
|
||||
int byteLength;
|
||||
int length;
|
||||
int bytesPerElement;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class ArrayBufferView {
|
||||
|
||||
|
||||
@@ -17,6 +31,7 @@ namespace lime {
|
||||
ArrayBufferView ();
|
||||
ArrayBufferView (int size);
|
||||
ArrayBufferView (value arrayBufferView);
|
||||
ArrayBufferView (HL_ArrayBufferView* arrayBufferView);
|
||||
~ArrayBufferView ();
|
||||
|
||||
unsigned char *Data ();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define LIME_UTILS_BYTES_H
|
||||
|
||||
|
||||
#include <hl.h>
|
||||
#include <hx/CFFI.h>
|
||||
#include <utils/QuickVec.h>
|
||||
|
||||
@@ -9,12 +10,22 @@
|
||||
namespace lime {
|
||||
|
||||
|
||||
struct HL_Bytes {
|
||||
|
||||
hl_type* t;
|
||||
int length;
|
||||
unsigned char* b;
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct Bytes {
|
||||
|
||||
|
||||
Bytes ();
|
||||
Bytes (int size);
|
||||
Bytes (value bytes);
|
||||
Bytes (HL_Bytes* bytes);
|
||||
Bytes (const char* path);
|
||||
Bytes (const QuickVec<unsigned char> data);
|
||||
~Bytes ();
|
||||
@@ -25,6 +36,7 @@ namespace lime {
|
||||
void ReadFile (const char* path);
|
||||
void Resize (int size);
|
||||
void Set (value bytes);
|
||||
void Set (HL_Bytes* bytes);
|
||||
void Set (const QuickVec<unsigned char> data);
|
||||
value Value ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user