1
0
Fork 0
mutter-performance-source/cogl/cogl-driver.h
Neil Roberts 60812e6a0e Add a vtable for the driver
Cogl already had a vtable for the texture driver. This ended up being
used for some things that are not strictly related to texturing such
as converting between pixel formats and GL enums. Some other functions
that are driver dependent such as updating the features were not
indirected through a vtable but instead switched directly by looking
at the ctx->driver enum value. This patch normalises to the two uses
by adding a separate vtable for driver functions not related to
texturing and moves the pixel format conversion functions to it from
the texture driver vtable. It also adds a context parameter to all of
the functions in the new driver vtable so that they won't have to rely
on the global context.
2012-03-23 13:51:08 +00:00

51 lines
1.5 KiB
C

/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2012 Intel Corporation.
*
* 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/>.
*
*
*/
#ifndef __COGL_DRIVER_H
#define __COGL_DRIVER_H
#include "cogl-context.h"
typedef struct _CoglDriverVtable CoglDriverVtable;
struct _CoglDriverVtable
{
gboolean
(* pixel_format_from_gl_internal) (CoglContext *context,
GLenum gl_int_format,
CoglPixelFormat *out_format);
CoglPixelFormat
(* pixel_format_to_gl) (CoglContext *context,
CoglPixelFormat format,
GLenum *out_glintformat,
GLenum *out_glformat,
GLenum *out_gltype);
gboolean
(* update_features) (CoglContext *context,
GError **error);
};
#endif /* __COGL_DRIVER_H */