Initial strict HL bindings for passing Image, Rectangle, Bytes

This commit is contained in:
Joshua Granick
2018-05-23 19:43:55 -07:00
parent f01e980114
commit 2fe10275e3
12 changed files with 369 additions and 1 deletions

View File

@@ -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 ();

View File

@@ -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 ();