[cogl/wip/frame-synchronization] Add missing cogl-output.c
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/frame-synchronization] Add missing cogl-output.c
- Date: Mon, 7 Jan 2013 17:25:44 +0000 (UTC)
commit 64e785fcfd96cd69ea99a6fa45453727d5f3f70a
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Mon Jan 7 12:24:13 2013 -0500
Add missing cogl-output.c
Should have been part of "Add CoglOutput and track for the GLX backend"
cogl/cogl-output.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 110 insertions(+), 0 deletions(-)
---
diff --git a/cogl/cogl-output.c b/cogl/cogl-output.c
new file mode 100644
index 0000000..1f5e78f
--- /dev/null
+++ b/cogl/cogl-output.c
@@ -0,0 +1,110 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2012 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl-output-private.h"
+
+#include <string.h>
+
+static void _cogl_output_free (CoglOutput *output);
+
+COGL_OBJECT_DEFINE (Output, output);
+
+CoglOutput *
+_cogl_output_new (const char *name)
+{
+ CoglOutput *output;
+
+ output = g_slice_new0 (CoglOutput);
+ output->name = g_strdup (name);
+
+ return _cogl_output_object_new (output);
+}
+
+static void
+_cogl_output_free (CoglOutput *output)
+{
+ g_free (output->name);
+
+ g_slice_free (CoglOutput, output);
+}
+
+gboolean
+_cogl_output_values_equal (CoglOutput *output,
+ CoglOutput *other)
+{
+ return memcmp ((const char *)output + G_STRUCT_OFFSET (CoglOutput, x),
+ (const char *)other + G_STRUCT_OFFSET (CoglOutput, x),
+ sizeof (CoglOutput) - G_STRUCT_OFFSET (CoglOutput, x)) == 0;
+}
+
+int
+cogl_output_get_x (CoglOutput *output)
+{
+ return output->x;
+}
+
+int
+cogl_output_get_y (CoglOutput *output)
+{
+ return output->y;
+}
+
+int
+cogl_output_get_width (CoglOutput *output)
+{
+ return output->width;
+}
+
+int
+cogl_output_get_height (CoglOutput *output)
+{
+ return output->height;
+}
+
+int
+cogl_output_get_mm_width (CoglOutput *output)
+{
+ return output->mm_width;
+}
+
+int
+cogl_output_get_mm_height (CoglOutput *output)
+{
+ return output->mm_height;
+}
+
+CoglSubpixelOrder
+cogl_output_get_subpixel_order (CoglOutput *output)
+{
+ return output->subpixel_order;
+}
+
+float
+cogl_output_get_refresh_rate (CoglOutput *output)
+{
+ return output->refresh_rate;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]