commit 401ed46da11ead0fd2b3ebeeaec23d9b375a98e4
parent 4c65a6cd254520d086679c6fc9d98cda94434c4e
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Fri, 24 Jun 2016 11:58:36 +0200
Add the ssol_image_get_layout and ssol_image_<map|unmap> functions
Diffstat:
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/ssol.h b/src/ssol.h
@@ -95,6 +95,14 @@ struct ssol_vertex_data {
void* ctx); /* Pointer toward user data */
};
+struct ssol_image_layout {
+ size_t row_pitch; /* #bytes between 2 consecutive row */
+ size_t offset; /* Byte offset where the image begins */
+ size_t size; /* Overall size of the image buffer */
+ size_t width, height; /* #pixels in X and Y */
+ enum ssol_pixel_format pixel_format; /* Format of a pixel */
+};
+
/* Invalid vertex data */
#define SSOL_VERTEX_DATA_NULL__ { SSOL_ATTRIBS_COUNT__, NULL }
static const struct ssol_vertex_data SSOL_VERTEX_DATA_NULL =
@@ -207,6 +215,20 @@ ssol_image_setup
const size_t height,
const enum ssol_pixel_format format);
+SSOL_API res_T
+ssol_image_get_layout
+ (const struct ssol_image* image,
+ struct ssol_image_layout* layout);
+
+SSOL_API res_T
+ssol_image_map
+ (const struct ssol_image* image,
+ void** memory);
+
+SSOL_API res_T
+ssol_image_unmap
+ (const struct ssol_image* image);
+
/*******************************************************************************
* Scene API - Opaque abstraction of the virtual environment. It contains a
* list of instantiated objects, handle a collection of light sources and
diff --git a/src/ssol_device.c b/src/ssol_device.c
@@ -28,7 +28,6 @@ device_release(ref_T* ref)
struct ssol_device* dev;
ASSERT(ref);
dev = CONTAINER_OF(ref, struct ssol_device, ref);
-
MEM_RM(dev->allocator, dev);
}
diff --git a/src/ssol_device_c.h b/src/ssol_device_c.h
@@ -17,7 +17,6 @@
#define SSOL_DEVICE_C_H
#include <rsys/ref_count.h>
-#include <rsys/free_list.h>
struct ssol_device {
struct logger* logger;