summaryrefslogtreecommitdiff
path: root/cogl/cogl.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-10-09 13:31:12 +0100
committerRobert Bragg <robert@linux.intel.com>2013-11-27 18:06:31 +0000
commit248a76f5eac7e5ae4fb45208577f9a55360812a7 (patch)
tree4a532be33254311a2a591501b263d4d4f5908a5c /cogl/cogl.h
parent71406438c5357eb4e0ef03e940c5456a536602a0 (diff)
downloadcogl-248a76f5eac7e5ae4fb45208577f9a55360812a7.tar.gz
Declare interface types as void and remove cast macros
This declares the interface types CoglFramebuffer, CoglBuffer, CoglTexture, CoglMetaTexture and CoglPrimitiveTexture as void when including the public cogl.h header so that users don't have to use lots of C type casts between instance types and interface types. This also removes all of the COGL_XYZ() type cast macros since they do nothing more than compile time type casting but it's less readable if you haven't seen that coding pattern before. Unlike with gobject based apis that use per-type macros for casting and performing runtime type checking we instead prefer to do our runtime type checking internally within the front-end public apis when objects are passed into Cogl. This greatly reduces the verbosity for users of the api and may help reduce the chance of excessive runtime type checking that can sometimes be a problem.
Diffstat (limited to 'cogl/cogl.h')
-rw-r--r--cogl/cogl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/cogl/cogl.h b/cogl/cogl.h
index c5ad6619..539a1271 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -25,6 +25,10 @@
#ifndef __COGL_H__
#define __COGL_H__
+#ifdef COGL_COMPILATION
+#error "<cogl/cogl.h> shouldn't be included internally"
+#endif
+
#define __COGL_H_INSIDE__
#include <cogl/cogl-defines.h>