am 74ed92d3: Merge "Move emugl system code to development.git"
* commit '74ed92d325ec1eb9287a79fff3ca62c7f0f864f8': Move emugl system code to development.git
This commit is contained in:
66
tools/emulator/opengl/Android.mk
Normal file
66
tools/emulator/opengl/Android.mk
Normal file
@@ -0,0 +1,66 @@
|
||||
# This is the top-level build file for the Android HW OpenGL ES emulation
|
||||
# in Android.
|
||||
#
|
||||
# You must define BUILD_EMULATOR_OPENGL to 'true' in your environment to
|
||||
# build the following files.
|
||||
#
|
||||
# Also define BUILD_EMULATOR_OPENGL_DRIVER to 'true' to build the gralloc
|
||||
# stuff as well.
|
||||
#
|
||||
ifeq (true,$(BUILD_EMULATOR_OPENGL))
|
||||
|
||||
# Top-level for all modules
|
||||
EMUGL_PATH := $(call my-dir)
|
||||
|
||||
# Directory containing common headers used by several modules
|
||||
# This is always set to a module's LOCAL_C_INCLUDES
|
||||
# See the definition of emugl-begin-module in common.mk
|
||||
#
|
||||
EMUGL_COMMON_INCLUDES := $(EMUGL_PATH)/host/include/libOpenglRender
|
||||
|
||||
# common cflags used by several modules
|
||||
# This is always set to a module's LOCAL_CFLAGS
|
||||
# See the definition of emugl-begin-module in common.mk
|
||||
#
|
||||
EMUGL_COMMON_CFLAGS := -DWITH_GLES2
|
||||
|
||||
# Uncomment the following line if you want to enable debug traces
|
||||
# in the GLES emulation libraries.
|
||||
# EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1
|
||||
|
||||
# Include common definitions used by all the modules included later
|
||||
# in this build file. This contains the definition of all useful
|
||||
# emugl-xxxx functions.
|
||||
#
|
||||
include $(EMUGL_PATH)/common.mk
|
||||
|
||||
# IMPORTANT: ORDER IS CRUCIAL HERE
|
||||
#
|
||||
# For the import/export feature to work properly, you must include
|
||||
# modules below in correct order. That is, if module B depends on
|
||||
# module A, then it must be included after module A below.
|
||||
#
|
||||
# This ensures that anything exported by module A will be correctly
|
||||
# be imported by module B when it is declared.
|
||||
#
|
||||
# Note that the build system will complain if you try to import a
|
||||
# module that hasn't been declared yet anyway.
|
||||
#
|
||||
|
||||
include $(EMUGL_PATH)/shared/OpenglOsUtils/Android.mk
|
||||
include $(EMUGL_PATH)/shared/OpenglCodecCommon/Android.mk
|
||||
|
||||
# System static libraries
|
||||
include $(EMUGL_PATH)/system/GLESv1_enc/Android.mk
|
||||
include $(EMUGL_PATH)/system/GLESv2_enc/Android.mk
|
||||
include $(EMUGL_PATH)/system/renderControl_enc/Android.mk
|
||||
include $(EMUGL_PATH)/system/OpenglSystemCommon/Android.mk
|
||||
|
||||
# System shared libraries
|
||||
include $(EMUGL_PATH)/system/GLESv1/Android.mk
|
||||
include $(EMUGL_PATH)/system/GLESv2/Android.mk
|
||||
|
||||
include $(EMUGL_PATH)/system/gralloc/Android.mk
|
||||
include $(EMUGL_PATH)/system/egl/Android.mk
|
||||
|
||||
endif # BUILD_EMULATOR_OPENGL == true
|
||||
3
tools/emulator/opengl/README
Normal file
3
tools/emulator/opengl/README
Normal file
@@ -0,0 +1,3 @@
|
||||
This directory contains Android-side modules related to hardware OpenGL ES
|
||||
emulation. The host-side modules and documentation are in
|
||||
$ANDROID_BUILD_TOP/sdk/emulator/opengl.
|
||||
242
tools/emulator/opengl/common.mk
Normal file
242
tools/emulator/opengl/common.mk
Normal file
@@ -0,0 +1,242 @@
|
||||
# This top-level build file is included by all modules that implement
|
||||
# the hardware OpenGL ES emulation for Android.
|
||||
#
|
||||
# We use it to ensure that all sub-Makefiles are included in the right
|
||||
# order for various variable definitions and usage to happen in the correct
|
||||
# order.
|
||||
#
|
||||
|
||||
# The following macros are used to start a new GLES emulation module.
|
||||
#
|
||||
# This will define LOCAL_MODULE as $1, plus a few other variables
|
||||
# needed by the build system (e.g. LOCAL_MODULE_TAGS, LOCAL_MODULE_CLASS...)
|
||||
#
|
||||
# NOTE: You still need to define LOCAL_PATH before this
|
||||
#
|
||||
# Usage example:
|
||||
#
|
||||
# $(call emugl-begin-static-library,<name>)
|
||||
# LOCAL_SRC_FILES := ....
|
||||
# LOCAL_C_INCLUDES += ....
|
||||
# $(call emugl-end-module)
|
||||
#
|
||||
emugl-begin-static-library = $(call emugl-begin-module,$1,STATIC_LIBRARY)
|
||||
emugl-begin-shared-library = $(call emugl-begin-module,$1,SHARED_LIBRARY)
|
||||
|
||||
# Internal list of all declared modules (used for sanity checking)
|
||||
_emugl_modules :=
|
||||
_emugl_HOST_modules :=
|
||||
|
||||
# do not use directly, see functions above instead
|
||||
emugl-begin-module = \
|
||||
$(eval include $(CLEAR_VARS)) \
|
||||
$(eval LOCAL_MODULE := $1) \
|
||||
$(eval LOCAL_MODULE_TAGS := debug) \
|
||||
$(eval LOCAL_MODULE_CLASS := $(patsubst HOST_%,%,$(patsubst %EXECUTABLE,%EXECUTABLES,$(patsubst %LIBRARY,%LIBRARIES,$2)))) \
|
||||
$(eval LOCAL_IS_HOST_MODULE := $(if $3,true,))\
|
||||
$(eval LOCAL_C_INCLUDES := $(EMUGL_COMMON_INCLUDES)) \
|
||||
$(eval LOCAL_CFLAGS := $(EMUGL_COMMON_CFLAGS)) \
|
||||
$(eval LOCAL_PRELINK_MODULE := false)\
|
||||
$(eval _EMUGL_INCLUDE_TYPE := $(BUILD_$2)) \
|
||||
$(call _emugl-init-module,$1,$2,$3)
|
||||
|
||||
# Used to end a module definition, see function definitions above
|
||||
emugl-end-module = \
|
||||
$(eval include $(_EMUGL_INCLUDE_TYPE))\
|
||||
$(eval _EMUGL_INCLUDE_TYPE :=) \
|
||||
$(eval _emugl_$(_emugl_HOST)modules += $(_emugl_MODULE))\
|
||||
$(if $(EMUGL_DEBUG),$(call emugl-dump-module))
|
||||
|
||||
# Managing module exports and imports.
|
||||
#
|
||||
# A module can 'import' another module, by calling emugl-import. This will
|
||||
# make the current LOCAL_MODULE inherit various definitions exported from
|
||||
# the imported module.
|
||||
#
|
||||
# Module exports are defined by calling emugl-export. Here is an example:
|
||||
#
|
||||
# $(call emugl-begin-static-library,foo)
|
||||
# LOCAL_SRC_FILES := foo.c
|
||||
# $(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
|
||||
# $(call emugl-export,SHARED_LIBRARIES,libcutils)
|
||||
# $(call emugl-end-module)
|
||||
#
|
||||
# $(call emugl-begin-shared-library,bar)
|
||||
# LOCAL_SRC_FILES := bar.cpp
|
||||
# $(call emugl-import,foo)
|
||||
# $(call emugl-end-module)
|
||||
#
|
||||
# Here, we define a static library named 'foo' which exports an include
|
||||
# path and a shared library requirement, and a shared library 'bar' which
|
||||
# imports it.
|
||||
#
|
||||
# What this means is that:
|
||||
#
|
||||
# - 'bar' will automatically inherit foo's LOCAL_PATH in its LOCAL_C_INCLUDES
|
||||
# - 'bar' will automatically inherit libcutils in its own LOCAL_SHARED_LIBRARIES
|
||||
#
|
||||
# Note that order of declaration matters. If 'foo' is defined after 'bar' in
|
||||
# the example above, nothing will work correctly because dependencies are
|
||||
# computed at import time.
|
||||
#
|
||||
#
|
||||
# IMPORTANT: Imports are transitive, i.e. when module A imports B,
|
||||
# it automatically imports anything imported by B too.
|
||||
|
||||
# This is the list of recognized export types we support for now.
|
||||
EMUGL_EXPORT_TYPES := \
|
||||
CFLAGS \
|
||||
LDLIBS \
|
||||
LDFLAGS \
|
||||
C_INCLUDES \
|
||||
SHARED_LIBRARIES \
|
||||
STATIC_LIBRARIES \
|
||||
ADDITIONAL_DEPENDENCIES
|
||||
|
||||
# Initialize a module in our database
|
||||
# $1: Module name
|
||||
# $2: Module type
|
||||
# $3: "HOST" for a host module, empty for a target one.
|
||||
_emugl-init-module = \
|
||||
$(eval _emugl_HOST := $(if $3,HOST_,))\
|
||||
$(eval _emugl_MODULE := $(_emugl_HOST)$1)\
|
||||
$(if $(filter $(_emugl_$(_emugl_HOST)modules),$(_emugl_MODULE)),\
|
||||
$(error There is already a $(if $3,host,) module named $1!)\
|
||||
)\
|
||||
$(eval _mod = $(_emugl_MODULE)) \
|
||||
$(eval _emugl.$(_mod).type := $(patsubst HOST_%,%,$2))\
|
||||
$(eval _emugl.$(_mod).imports :=) \
|
||||
$(eval _emugl,$(_mod).moved :=) \
|
||||
$(foreach _type,$(EMUGL_EXPORT_TYPES),\
|
||||
$(eval _emugl.$(_mod).export.$(_type) :=)\
|
||||
)
|
||||
|
||||
# Called to indicate that a module exports a given local variable for its
|
||||
# users. This also adds this to LOCAL_$1
|
||||
# $1: Local variable type (e.g. CFLAGS, LDLIBS, etc...)
|
||||
# $2: Value(s) to append to the export
|
||||
emugl-export = \
|
||||
$(eval _emugl.$(_emugl_MODULE).export.$1 += $2)\
|
||||
$(eval LOCAL_$1 := $2 $(LOCAL_$1))
|
||||
|
||||
emugl-export-outer = \
|
||||
$(eval _emugl.$(_emugl_MODULE).export.$1 += $2)
|
||||
|
||||
# Called to indicate that a module imports the exports of another module
|
||||
# $1: list of modules to import
|
||||
#
|
||||
emugl-import = \
|
||||
$(foreach _imod,$1,\
|
||||
$(call _emugl-module-import,$(_emugl_HOST)$(_imod))\
|
||||
)
|
||||
|
||||
_emugl-module-import = \
|
||||
$(eval _mod := $(_emugl_MODULE))\
|
||||
$(if $(filter-out $(_emugl_$(_emugl_HOST)modules),$1),\
|
||||
$(info Unknown imported emugles module: $1)\
|
||||
$(if $(_emugl_HOST),\
|
||||
$(eval _names := $(patsubst HOST_%,%,$(_emugl_HOST_modules))),\
|
||||
$(eval _names := $(_emugl_modules))\
|
||||
)\
|
||||
$(info Please one of the following names: $(_names))\
|
||||
$(error Aborting)\
|
||||
)\
|
||||
$(if $(filter-out $(_emugl.$(_mod).imports),$1),\
|
||||
$(eval _emugl.$(_mod).imports += $1)\
|
||||
$(foreach _sub,$(_emugl.$1.imports),\
|
||||
$(call _emugl-module-import,$(_sub))\
|
||||
)\
|
||||
$(foreach _type,$(EMUGL_EXPORT_TYPES),\
|
||||
$(eval LOCAL_$(_type) := $(_emugl.$1.export.$(_type)) $(LOCAL_$(_type)))\
|
||||
)\
|
||||
$(if $(filter EXECUTABLE SHARED_LIBRARY,$(_emugl.$(_emugl_MODULE).type)),\
|
||||
$(if $(filter STATIC_LIBRARY,$(_emugl.$1.type)),\
|
||||
$(eval LOCAL_STATIC_LIBRARIES := $(1:HOST_%=%) $(LOCAL_STATIC_LIBRARIES))\
|
||||
)\
|
||||
$(if $(filter SHARED_LIBRARY,$(_emugl.$1.type)),\
|
||||
$(if $(_emugl.$1.moved),,\
|
||||
$(eval LOCAL_SHARED_LIBRARIES := $(1:HOST_%=%) $(LOCAL_SHARED_LIBRARIES))\
|
||||
)\
|
||||
)\
|
||||
)\
|
||||
)
|
||||
|
||||
_emugl-dump-list = \
|
||||
$(foreach _list_item,$(strip $1),$(info . $(_list_item)))
|
||||
|
||||
emugl-dump-module = \
|
||||
$(info MODULE=$(_emugl_MODULE))\
|
||||
$(info . HOST=$(_emugl_HOST))\
|
||||
$(info . TYPE=$(_emugl.$(_emugl_MODULE).type))\
|
||||
$(info . IMPORTS=$(_emugl.$(_emugl_MODULE).imports))\
|
||||
$(foreach _type,$(EMUGL_EXPORT_TYPES),\
|
||||
$(if $(filter C_INCLUDES ADDITIONAL_DEPENDENCIES,$(_type)),\
|
||||
$(info . EXPORT.$(_type) :=)\
|
||||
$(call _emugl-dump-list,$(_emugl.$(_emugl_MODULE).export.$(_type)))\
|
||||
$(info . LOCAL_$(_type) :=)\
|
||||
$(call _emugl-dump-list,$(LOCAL_$(_type)))\
|
||||
,\
|
||||
$(info . EXPORT.$(_type) := $(strip $(_emugl.$(_emugl_MODULE).export.$(_type))))\
|
||||
$(info . LOCAL_$(_type) := $(strip $(LOCAL_$(_type))))\
|
||||
)\
|
||||
)\
|
||||
$(info . LOCAL_SRC_FILES := $(LOCAL_SRC_FILES))\
|
||||
|
||||
# This function can be called to generate the wrapper source files.
|
||||
# LOCAL_MODULE and LOCAL_MODULE_CLASS must be defined or the build will abort.
|
||||
# Source files will be stored in the local intermediates directory that will
|
||||
# be automatically added to your LOCAL_C_INCLUDES.
|
||||
# Usage:
|
||||
# $(call emugl-gen-wrapper,<input-dir>,<basename>)
|
||||
#
|
||||
emugl-gen-wrapper = \
|
||||
$(eval _emugl_out := $(call local-intermediates-dir)) \
|
||||
$(call emugl-gen-wrapper-generic,$(_emugl_out),$1,$2) \
|
||||
$(call emugl-export,C_INCLUDES,$(_emugl_out))
|
||||
|
||||
# DO NOT CALL DIRECTLY, USE emugl-gen-wrapper instead.
|
||||
#
|
||||
# The following function can be called to generate GL library wrapper
|
||||
# Usage is:
|
||||
#
|
||||
# $(call emugl-gen-wrapper-generic,<dst-dir>,<src-dir>,<basename>)
|
||||
#
|
||||
# <dst-dir> is the destination directory where the generated sources are stored
|
||||
# <src-dir> is the source directory where to find <basename>.attrib, etc..
|
||||
# <basename> is the emugen basename (see host/tools/emugen/README)
|
||||
#
|
||||
emugl-gen-wrapper-generic = $(eval $(emugl-gen-wrapper-generic-ev))
|
||||
|
||||
define emugl-gen-wrapper-generic-ev
|
||||
_emugl_wrap := $$1/$$3
|
||||
_emugl_src := $$2/$$3
|
||||
GEN := $$(_emugl_wrap)_wrapper_entry.cpp \
|
||||
$$(_emugl_wrap)_wrapper_context.cpp \
|
||||
$$(_emugl_wrap)_wrapper_context.h \
|
||||
$$(_emugl_wrap)_wrapper_proc.h
|
||||
|
||||
$$(GEN): PRIVATE_PATH := $$(LOCAL_PATH)
|
||||
$$(GEN): PRIVATE_CUSTOM_TOOL := $$(EMUGL_EMUGEN) -W $$1 -i $$2 $$3
|
||||
$$(GEN): $$(EMUGL_EMUGEN) $$(_emugl_src).attrib $$(_emugl_src).in $$(_emugl_src).types
|
||||
$$(transform-generated-source)
|
||||
|
||||
$$(call emugl-export,ADDITIONAL_DEPENDENCIES,$$(GEN))
|
||||
LOCAL_GENERATED_SOURCES += $$(GEN)
|
||||
LOCAL_C_INCLUDES += $$1
|
||||
|
||||
#ifneq ($$(HOST_OS),windows)
|
||||
$$(call emugl-export,LDFLAGS,-ldl)
|
||||
#endif
|
||||
|
||||
endef
|
||||
|
||||
# Call this function when your shared library must be placed in a non-standard
|
||||
# library path (i.e. not under /system/lib
|
||||
# $1: library sub-path,relative to /system/lib
|
||||
# For example: $(call emugl-set-shared-library-subpath,egl)
|
||||
emugl-set-shared-library-subpath = \
|
||||
$(eval LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/$1)\
|
||||
$(eval LOCAL_UNSTRIPPED_PATH := $(TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)/$1)\
|
||||
$(eval _emugl.$(LOCAL_MODULE).moved := true)\
|
||||
$(call emugl-export-outer,ADDITIONAL_DEPENDENCIES,$(LOCAL_MODULE_PATH)/$(LOCAL_MODULE)$(TARGET_SHLIB_SUFFIX))
|
||||
|
||||
102
tools/emulator/opengl/host/include/libOpenglRender/IOStream.h
Normal file
102
tools/emulator/opengl/host/include/libOpenglRender/IOStream.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __IO_STREAM_H__
|
||||
#define __IO_STREAM_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ErrorLog.h"
|
||||
|
||||
class IOStream {
|
||||
public:
|
||||
|
||||
IOStream(size_t bufSize) {
|
||||
m_buf = NULL;
|
||||
m_bufsize = bufSize;
|
||||
m_free = 0;
|
||||
}
|
||||
|
||||
virtual void *allocBuffer(size_t minSize) = 0;
|
||||
virtual int commitBuffer(size_t size) = 0;
|
||||
virtual const unsigned char *readFully( void *buf, size_t len) = 0;
|
||||
virtual const unsigned char *read( void *buf, size_t *inout_len) = 0;
|
||||
virtual int writeFully(const void* buf, size_t len) = 0;
|
||||
|
||||
virtual ~IOStream() {
|
||||
|
||||
// NOTE: m_buf is 'owned' by the child class thus we expect it to be released by it
|
||||
}
|
||||
|
||||
unsigned char *alloc(size_t len) {
|
||||
|
||||
if (m_buf && len > m_free) {
|
||||
if (flush() < 0) {
|
||||
ERR("Failed to flush in alloc\n");
|
||||
return NULL; // we failed to flush so something is wrong
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_buf || len > m_bufsize) {
|
||||
int allocLen = m_bufsize < len ? len : m_bufsize;
|
||||
m_buf = (unsigned char *)allocBuffer(allocLen);
|
||||
if (!m_buf) {
|
||||
ERR("Alloc (%u bytes) failed\n", allocLen);
|
||||
return NULL;
|
||||
}
|
||||
m_bufsize = m_free = allocLen;
|
||||
}
|
||||
|
||||
unsigned char *ptr;
|
||||
|
||||
ptr = m_buf + (m_bufsize - m_free);
|
||||
m_free -= len;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
int flush() {
|
||||
|
||||
if (!m_buf || m_free == m_bufsize) return 0;
|
||||
|
||||
int stat = commitBuffer(m_bufsize - m_free);
|
||||
m_buf = NULL;
|
||||
m_free = 0;
|
||||
return stat;
|
||||
}
|
||||
|
||||
const unsigned char *readback(void *buf, size_t len) {
|
||||
flush();
|
||||
return readFully(buf, len);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
unsigned char *m_buf;
|
||||
size_t m_bufsize;
|
||||
size_t m_free;
|
||||
};
|
||||
|
||||
//
|
||||
// When a client opens a connection to the renderer, it should
|
||||
// send unsigned int value indicating the "clientFlags".
|
||||
// The following are the bitmask of the clientFlags.
|
||||
// currently only one bit is used which flags the server
|
||||
// it should exit.
|
||||
//
|
||||
#define IOSTREAM_CLIENT_EXIT_SERVER 1
|
||||
|
||||
#endif
|
||||
23
tools/emulator/opengl/shared/OpenglCodecCommon/Android.mk
Normal file
23
tools/emulator/opengl/shared/OpenglCodecCommon/Android.mk
Normal file
@@ -0,0 +1,23 @@
|
||||
# This build script corresponds to a library containing many definitions
|
||||
# common to both the guest and the host. They relate to
|
||||
#
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
commonSources := \
|
||||
GLClientState.cpp \
|
||||
GLSharedGroup.cpp \
|
||||
glUtils.cpp \
|
||||
SocketStream.cpp \
|
||||
TcpStream.cpp \
|
||||
TimeUtils.cpp
|
||||
|
||||
### CodecCommon guest ##############################################
|
||||
$(call emugl-begin-static-library,libOpenglCodecCommon)
|
||||
|
||||
LOCAL_SRC_FILES := $(commonSources)
|
||||
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"eglCodecCommon\"
|
||||
|
||||
$(call emugl-export,SHARED_LIBRARIES,libcutils libutils)
|
||||
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
|
||||
$(call emugl-end-module)
|
||||
37
tools/emulator/opengl/shared/OpenglCodecCommon/ErrorLog.h
Normal file
37
tools/emulator/opengl/shared/OpenglCodecCommon/ErrorLog.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _ERROR_LOG_H_
|
||||
#define _ERROR_LOG_H_
|
||||
|
||||
#if (HAVE_ANDROID_OS == 1)
|
||||
# include <cutils/log.h>
|
||||
# define ERR(...) ALOGE(__VA_ARGS__)
|
||||
# ifdef EMUGL_DEBUG
|
||||
# define DBG(...) ALOGD(__VA_ARGS__)
|
||||
# else
|
||||
# define DBG(...) ((void)0)
|
||||
# endif
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# define ERR(...) fprintf(stderr, __VA_ARGS__)
|
||||
# ifdef EMUGL_DEBUG
|
||||
# define DBG(...) fprintf(stderr, __VA_ARGS__)
|
||||
# else
|
||||
# define DBG(...) ((void)0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
53
tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h
Normal file
53
tools/emulator/opengl/shared/OpenglCodecCommon/FixedBuffer.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _FIXED_BUFFER_H
|
||||
#define _FIXED_BUFFER_H
|
||||
|
||||
class FixedBuffer {
|
||||
public:
|
||||
FixedBuffer(size_t initialSize = 0) {
|
||||
m_buffer = NULL;
|
||||
m_bufferLen = 0;
|
||||
alloc(m_bufferLen);
|
||||
}
|
||||
|
||||
~FixedBuffer() {
|
||||
delete [] m_buffer;
|
||||
m_bufferLen = 0;
|
||||
}
|
||||
|
||||
void * alloc(size_t size) {
|
||||
if (m_bufferLen >= size)
|
||||
return (void *)(m_buffer);
|
||||
|
||||
if (m_buffer != NULL)
|
||||
delete[] m_buffer;
|
||||
|
||||
m_bufferLen = size;
|
||||
m_buffer = new unsigned char[m_bufferLen];
|
||||
if (m_buffer == NULL)
|
||||
m_bufferLen = 0;
|
||||
|
||||
return m_buffer;
|
||||
}
|
||||
void *ptr() { return m_buffer; }
|
||||
size_t len() { return m_bufferLen; }
|
||||
private:
|
||||
unsigned char *m_buffer;
|
||||
size_t m_bufferLen;
|
||||
};
|
||||
|
||||
#endif
|
||||
417
tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.cpp
Normal file
417
tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.cpp
Normal file
@@ -0,0 +1,417 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "GLClientState.h"
|
||||
#include "ErrorLog.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "glUtils.h"
|
||||
#include <cutils/log.h>
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a, b) ((a) < (b) ? (b) : (a))
|
||||
#endif
|
||||
|
||||
GLClientState::GLClientState(int nLocations)
|
||||
{
|
||||
if (nLocations < LAST_LOCATION) {
|
||||
nLocations = LAST_LOCATION;
|
||||
}
|
||||
m_nLocations = nLocations;
|
||||
m_states = new VertexAttribState[m_nLocations];
|
||||
for (int i = 0; i < m_nLocations; i++) {
|
||||
m_states[i].enabled = 0;
|
||||
m_states[i].enableDirty = false;
|
||||
}
|
||||
m_currentArrayVbo = 0;
|
||||
m_currentIndexVbo = 0;
|
||||
// init gl constans;
|
||||
m_states[VERTEX_LOCATION].glConst = GL_VERTEX_ARRAY;
|
||||
m_states[NORMAL_LOCATION].glConst = GL_NORMAL_ARRAY;
|
||||
m_states[COLOR_LOCATION].glConst = GL_COLOR_ARRAY;
|
||||
m_states[POINTSIZE_LOCATION].glConst = GL_POINT_SIZE_ARRAY_OES;
|
||||
m_states[TEXCOORD0_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[TEXCOORD1_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[TEXCOORD2_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[TEXCOORD3_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[TEXCOORD4_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[TEXCOORD5_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[TEXCOORD6_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[TEXCOORD7_LOCATION].glConst = GL_TEXTURE_COORD_ARRAY;
|
||||
m_states[MATRIXINDEX_LOCATION].glConst = GL_MATRIX_INDEX_ARRAY_OES;
|
||||
m_states[WEIGHT_LOCATION].glConst = GL_WEIGHT_ARRAY_OES;
|
||||
m_activeTexture = 0;
|
||||
m_currentProgram = 0;
|
||||
|
||||
m_pixelStore.unpack_alignment = 4;
|
||||
m_pixelStore.pack_alignment = 4;
|
||||
|
||||
memset(m_tex.unit, 0, sizeof(m_tex.unit));
|
||||
m_tex.activeUnit = &m_tex.unit[0];
|
||||
m_tex.textures = NULL;
|
||||
m_tex.numTextures = 0;
|
||||
m_tex.allocTextures = 0;
|
||||
}
|
||||
|
||||
GLClientState::~GLClientState()
|
||||
{
|
||||
delete m_states;
|
||||
}
|
||||
|
||||
void GLClientState::enable(int location, int state)
|
||||
{
|
||||
if (!validLocation(location)) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_states[location].enableDirty |= (state != m_states[location].enabled);
|
||||
m_states[location].enabled = state;
|
||||
}
|
||||
|
||||
void GLClientState::setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data)
|
||||
{
|
||||
if (!validLocation(location)) {
|
||||
return;
|
||||
}
|
||||
m_states[location].size = size;
|
||||
m_states[location].type = type;
|
||||
m_states[location].stride = stride;
|
||||
m_states[location].data = (void*)data;
|
||||
m_states[location].bufferObject = m_currentArrayVbo;
|
||||
m_states[location].elementSize = glSizeof(type) * size;
|
||||
m_states[location].normalized = normalized;
|
||||
}
|
||||
|
||||
void GLClientState::setBufferObject(int location, GLuint id)
|
||||
{
|
||||
if (!validLocation(location)) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_states[location].bufferObject = id;
|
||||
}
|
||||
|
||||
const GLClientState::VertexAttribState * GLClientState::getState(int location)
|
||||
{
|
||||
if (!validLocation(location)) {
|
||||
return NULL;
|
||||
}
|
||||
return & m_states[location];
|
||||
}
|
||||
|
||||
const GLClientState::VertexAttribState * GLClientState::getStateAndEnableDirty(int location, bool *enableChanged)
|
||||
{
|
||||
if (!validLocation(location)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (enableChanged) {
|
||||
*enableChanged = m_states[location].enableDirty;
|
||||
}
|
||||
|
||||
m_states[location].enableDirty = false;
|
||||
return & m_states[location];
|
||||
}
|
||||
|
||||
int GLClientState::getLocation(GLenum loc)
|
||||
{
|
||||
int retval;
|
||||
|
||||
switch(loc) {
|
||||
case GL_VERTEX_ARRAY:
|
||||
retval = int(VERTEX_LOCATION);
|
||||
break;
|
||||
case GL_NORMAL_ARRAY:
|
||||
retval = int(NORMAL_LOCATION);
|
||||
break;
|
||||
case GL_COLOR_ARRAY:
|
||||
retval = int(COLOR_LOCATION);
|
||||
break;
|
||||
case GL_POINT_SIZE_ARRAY_OES:
|
||||
retval = int(POINTSIZE_LOCATION);
|
||||
break;
|
||||
case GL_TEXTURE_COORD_ARRAY:
|
||||
retval = int (TEXCOORD0_LOCATION + m_activeTexture);
|
||||
break;
|
||||
case GL_MATRIX_INDEX_ARRAY_OES:
|
||||
retval = int (MATRIXINDEX_LOCATION);
|
||||
break;
|
||||
case GL_WEIGHT_ARRAY_OES:
|
||||
retval = int (WEIGHT_LOCATION);
|
||||
break;
|
||||
default:
|
||||
retval = loc;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void GLClientState::getClientStatePointer(GLenum pname, GLvoid** params)
|
||||
{
|
||||
const GLClientState::VertexAttribState *state = NULL;
|
||||
switch (pname) {
|
||||
case GL_VERTEX_ARRAY_POINTER: {
|
||||
state = getState(GLClientState::VERTEX_LOCATION);
|
||||
break;
|
||||
}
|
||||
case GL_NORMAL_ARRAY_POINTER: {
|
||||
state = getState(GLClientState::NORMAL_LOCATION);
|
||||
break;
|
||||
}
|
||||
case GL_COLOR_ARRAY_POINTER: {
|
||||
state = getState(GLClientState::COLOR_LOCATION);
|
||||
break;
|
||||
}
|
||||
case GL_TEXTURE_COORD_ARRAY_POINTER: {
|
||||
state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
|
||||
break;
|
||||
}
|
||||
case GL_POINT_SIZE_ARRAY_POINTER_OES: {
|
||||
state = getState(GLClientState::POINTSIZE_LOCATION);
|
||||
break;
|
||||
}
|
||||
case GL_MATRIX_INDEX_ARRAY_POINTER_OES: {
|
||||
state = getState(GLClientState::MATRIXINDEX_LOCATION);
|
||||
break;
|
||||
}
|
||||
case GL_WEIGHT_ARRAY_POINTER_OES: {
|
||||
state = getState(GLClientState::WEIGHT_LOCATION);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (state && params)
|
||||
*params = state->data;
|
||||
}
|
||||
|
||||
int GLClientState::setPixelStore(GLenum param, GLint value)
|
||||
{
|
||||
int retval = 0;
|
||||
switch(param) {
|
||||
case GL_UNPACK_ALIGNMENT:
|
||||
if (value == 1 || value == 2 || value == 4 || value == 8) {
|
||||
m_pixelStore.unpack_alignment = value;
|
||||
} else {
|
||||
retval = GL_INVALID_VALUE;
|
||||
}
|
||||
break;
|
||||
case GL_PACK_ALIGNMENT:
|
||||
if (value == 1 || value == 2 || value == 4 || value == 8) {
|
||||
m_pixelStore.pack_alignment = value;
|
||||
} else {
|
||||
retval = GL_INVALID_VALUE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
retval = GL_INVALID_ENUM;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
size_t GLClientState::pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack) const
|
||||
{
|
||||
int pixelsize = glUtilsPixelBitSize(format, type) >> 3;
|
||||
|
||||
int alignment = pack ? m_pixelStore.pack_alignment : m_pixelStore.unpack_alignment;
|
||||
|
||||
if (pixelsize == 0 ) {
|
||||
ERR("unknown pixel size: width: %d height: %d format: %d type: %d pack: %d align: %d\n",
|
||||
width, height, format, type, pack, alignment);
|
||||
}
|
||||
size_t linesize = pixelsize * width;
|
||||
size_t aligned_linesize = int(linesize / alignment) * alignment;
|
||||
if (aligned_linesize < linesize) {
|
||||
aligned_linesize += alignment;
|
||||
}
|
||||
return aligned_linesize * height;
|
||||
}
|
||||
|
||||
GLenum GLClientState::setActiveTextureUnit(GLenum texture)
|
||||
{
|
||||
GLuint unit = texture - GL_TEXTURE0;
|
||||
if (unit >= MAX_TEXTURE_UNITS) {
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
m_tex.activeUnit = &m_tex.unit[unit];
|
||||
return GL_NO_ERROR;
|
||||
}
|
||||
|
||||
GLenum GLClientState::getActiveTextureUnit() const
|
||||
{
|
||||
return GL_TEXTURE0 + (m_tex.activeUnit - &m_tex.unit[0]);
|
||||
}
|
||||
|
||||
void GLClientState::enableTextureTarget(GLenum target)
|
||||
{
|
||||
switch (target) {
|
||||
case GL_TEXTURE_2D:
|
||||
m_tex.activeUnit->enables |= (1u << TEXTURE_2D);
|
||||
break;
|
||||
case GL_TEXTURE_EXTERNAL_OES:
|
||||
m_tex.activeUnit->enables |= (1u << TEXTURE_EXTERNAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GLClientState::disableTextureTarget(GLenum target)
|
||||
{
|
||||
switch (target) {
|
||||
case GL_TEXTURE_2D:
|
||||
m_tex.activeUnit->enables &= ~(1u << TEXTURE_2D);
|
||||
break;
|
||||
case GL_TEXTURE_EXTERNAL_OES:
|
||||
m_tex.activeUnit->enables &= ~(1u << TEXTURE_EXTERNAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GLenum GLClientState::getPriorityEnabledTarget(GLenum allDisabled) const
|
||||
{
|
||||
unsigned int enables = m_tex.activeUnit->enables;
|
||||
if (enables & (1u << TEXTURE_EXTERNAL)) {
|
||||
return GL_TEXTURE_EXTERNAL_OES;
|
||||
} else if (enables & (1u << TEXTURE_2D)) {
|
||||
return GL_TEXTURE_2D;
|
||||
} else {
|
||||
return allDisabled;
|
||||
}
|
||||
}
|
||||
|
||||
int GLClientState::compareTexId(const void* pid, const void* prec)
|
||||
{
|
||||
const GLuint* id = (const GLuint*)pid;
|
||||
const TextureRec* rec = (const TextureRec*)prec;
|
||||
return (GLint)(*id) - (GLint)rec->id;
|
||||
}
|
||||
|
||||
GLenum GLClientState::bindTexture(GLenum target, GLuint texture,
|
||||
GLboolean* firstUse)
|
||||
{
|
||||
GLboolean first = GL_FALSE;
|
||||
TextureRec* texrec = NULL;
|
||||
if (texture != 0) {
|
||||
if (m_tex.textures) {
|
||||
texrec = (TextureRec*)bsearch(&texture, m_tex.textures,
|
||||
m_tex.numTextures, sizeof(TextureRec), compareTexId);
|
||||
}
|
||||
if (!texrec) {
|
||||
if (!(texrec = addTextureRec(texture, target))) {
|
||||
return GL_OUT_OF_MEMORY;
|
||||
}
|
||||
first = GL_TRUE;
|
||||
}
|
||||
if (target != texrec->target) {
|
||||
return GL_INVALID_OPERATION;
|
||||
}
|
||||
}
|
||||
|
||||
switch (target) {
|
||||
case GL_TEXTURE_2D:
|
||||
m_tex.activeUnit->texture[TEXTURE_2D] = texture;
|
||||
break;
|
||||
case GL_TEXTURE_EXTERNAL_OES:
|
||||
m_tex.activeUnit->texture[TEXTURE_EXTERNAL] = texture;
|
||||
break;
|
||||
}
|
||||
|
||||
if (firstUse) {
|
||||
*firstUse = first;
|
||||
}
|
||||
|
||||
return GL_NO_ERROR;
|
||||
}
|
||||
|
||||
GLClientState::TextureRec* GLClientState::addTextureRec(GLuint id,
|
||||
GLenum target)
|
||||
{
|
||||
if (m_tex.numTextures == m_tex.allocTextures) {
|
||||
const GLuint MAX_TEXTURES = 0xFFFFFFFFu;
|
||||
|
||||
GLuint newAlloc;
|
||||
if (MAX_TEXTURES - m_tex.allocTextures >= m_tex.allocTextures) {
|
||||
newAlloc = MAX(4, 2 * m_tex.allocTextures);
|
||||
} else {
|
||||
if (m_tex.allocTextures == MAX_TEXTURES) {
|
||||
return NULL;
|
||||
}
|
||||
newAlloc = MAX_TEXTURES;
|
||||
}
|
||||
|
||||
TextureRec* newTextures = (TextureRec*)realloc(m_tex.textures,
|
||||
newAlloc * sizeof(TextureRec));
|
||||
if (!newTextures) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_tex.textures = newTextures;
|
||||
m_tex.allocTextures = newAlloc;
|
||||
}
|
||||
|
||||
TextureRec* tex = m_tex.textures + m_tex.numTextures;
|
||||
TextureRec* prev = tex - 1;
|
||||
while (tex != m_tex.textures && id < prev->id) {
|
||||
*tex-- = *prev--;
|
||||
}
|
||||
tex->id = id;
|
||||
tex->target = target;
|
||||
m_tex.numTextures++;
|
||||
|
||||
return tex;
|
||||
}
|
||||
|
||||
GLuint GLClientState::getBoundTexture(GLenum target) const
|
||||
{
|
||||
switch (target) {
|
||||
case GL_TEXTURE_2D:
|
||||
return m_tex.activeUnit->texture[TEXTURE_2D];
|
||||
case GL_TEXTURE_EXTERNAL_OES:
|
||||
return m_tex.activeUnit->texture[TEXTURE_EXTERNAL];
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void GLClientState::deleteTextures(GLsizei n, const GLuint* textures)
|
||||
{
|
||||
// Updating the textures array could be made more efficient when deleting
|
||||
// several textures:
|
||||
// - compacting the array could be done in a single pass once the deleted
|
||||
// textures are marked, or
|
||||
// - could swap deleted textures to the end and re-sort.
|
||||
TextureRec* texrec;
|
||||
for (const GLuint* texture = textures; texture != textures + n; texture++) {
|
||||
texrec = (TextureRec*)bsearch(texture, m_tex.textures,
|
||||
m_tex.numTextures, sizeof(TextureRec), compareTexId);
|
||||
if (texrec) {
|
||||
const TextureRec* end = m_tex.textures + m_tex.numTextures;
|
||||
memmove(texrec, texrec + 1,
|
||||
(end - texrec - 1) * sizeof(TextureRec));
|
||||
m_tex.numTextures--;
|
||||
|
||||
for (TextureUnit* unit = m_tex.unit;
|
||||
unit != m_tex.unit + MAX_TEXTURE_UNITS;
|
||||
unit++)
|
||||
{
|
||||
if (unit->texture[TEXTURE_2D] == *texture) {
|
||||
unit->texture[TEXTURE_2D] = 0;
|
||||
} else if (unit->texture[TEXTURE_EXTERNAL] == *texture) {
|
||||
unit->texture[TEXTURE_EXTERNAL] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
441
tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h
Normal file
441
tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h
Normal file
@@ -0,0 +1,441 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _GL_CLIENT_STATE_H_
|
||||
#define _GL_CLIENT_STATE_H_
|
||||
|
||||
#define GL_API
|
||||
#ifndef ANDROID
|
||||
#define GL_APIENTRY
|
||||
#define GL_APIENTRYP
|
||||
#endif
|
||||
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "ErrorLog.h"
|
||||
#include "codec_defs.h"
|
||||
|
||||
class GLClientState {
|
||||
public:
|
||||
typedef enum {
|
||||
VERTEX_LOCATION = 0,
|
||||
NORMAL_LOCATION = 1,
|
||||
COLOR_LOCATION = 2,
|
||||
POINTSIZE_LOCATION = 3,
|
||||
TEXCOORD0_LOCATION = 4,
|
||||
TEXCOORD1_LOCATION = 5,
|
||||
TEXCOORD2_LOCATION = 6,
|
||||
TEXCOORD3_LOCATION = 7,
|
||||
TEXCOORD4_LOCATION = 8,
|
||||
TEXCOORD5_LOCATION = 9,
|
||||
TEXCOORD6_LOCATION = 10,
|
||||
TEXCOORD7_LOCATION = 11,
|
||||
MATRIXINDEX_LOCATION = 12,
|
||||
WEIGHT_LOCATION = 13,
|
||||
LAST_LOCATION = 14
|
||||
} StateLocation;
|
||||
|
||||
typedef struct {
|
||||
GLint enabled;
|
||||
GLint size;
|
||||
GLenum type;
|
||||
GLsizei stride;
|
||||
void *data;
|
||||
GLuint bufferObject;
|
||||
GLenum glConst;
|
||||
unsigned int elementSize;
|
||||
bool enableDirty; // true if any enable state has changed since last draw
|
||||
bool normalized;
|
||||
} VertexAttribState;
|
||||
|
||||
typedef struct {
|
||||
int unpack_alignment;
|
||||
int pack_alignment;
|
||||
} PixelStoreState;
|
||||
|
||||
enum {
|
||||
MAX_TEXTURE_UNITS = 32,
|
||||
};
|
||||
|
||||
public:
|
||||
GLClientState(int nLocations = CODEC_MAX_VERTEX_ATTRIBUTES);
|
||||
~GLClientState();
|
||||
int nLocations() { return m_nLocations; }
|
||||
const PixelStoreState *pixelStoreState() { return &m_pixelStore; }
|
||||
int setPixelStore(GLenum param, GLint value);
|
||||
GLuint currentArrayVbo() { return m_currentArrayVbo; }
|
||||
GLuint currentIndexVbo() { return m_currentIndexVbo; }
|
||||
void enable(int location, int state);
|
||||
void setState(int location, int size, GLenum type, GLboolean normalized, GLsizei stride, const void *data);
|
||||
void setBufferObject(int location, GLuint id);
|
||||
const VertexAttribState *getState(int location);
|
||||
const VertexAttribState *getStateAndEnableDirty(int location, bool *enableChanged);
|
||||
int getLocation(GLenum loc);
|
||||
void setActiveTexture(int texUnit) {m_activeTexture = texUnit; };
|
||||
int getActiveTexture() const { return m_activeTexture; }
|
||||
|
||||
int bindBuffer(GLenum target, GLuint id)
|
||||
{
|
||||
int err = 0;
|
||||
switch(target) {
|
||||
case GL_ARRAY_BUFFER:
|
||||
m_currentArrayVbo = id;
|
||||
break;
|
||||
case GL_ELEMENT_ARRAY_BUFFER:
|
||||
m_currentIndexVbo = id;
|
||||
break;
|
||||
default:
|
||||
err = -1;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
int getBuffer(GLenum target)
|
||||
{
|
||||
int ret=0;
|
||||
switch (target) {
|
||||
case GL_ARRAY_BUFFER:
|
||||
ret = m_currentArrayVbo;
|
||||
break;
|
||||
case GL_ELEMENT_ARRAY_BUFFER:
|
||||
ret = m_currentIndexVbo;
|
||||
break;
|
||||
default:
|
||||
ret = -1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
size_t pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack) const;
|
||||
|
||||
void setCurrentProgram(GLint program) { m_currentProgram = program; }
|
||||
GLint currentProgram() const { return m_currentProgram; }
|
||||
|
||||
/* OES_EGL_image_external
|
||||
*
|
||||
* These functions manipulate GL state which interacts with the
|
||||
* OES_EGL_image_external extension, to support client-side emulation on
|
||||
* top of host implementations that don't have it.
|
||||
*
|
||||
* Most of these calls should only be used with TEXTURE_2D or
|
||||
* TEXTURE_EXTERNAL_OES texture targets; TEXTURE_CUBE_MAP or other extension
|
||||
* targets should bypass this. An exception is bindTexture(), which should
|
||||
* see all glBindTexture() calls for any target.
|
||||
*/
|
||||
|
||||
// glActiveTexture(GL_TEXTURE0 + i)
|
||||
// Sets the active texture unit. Up to MAX_TEXTURE_UNITS are supported.
|
||||
GLenum setActiveTextureUnit(GLenum texture);
|
||||
GLenum getActiveTextureUnit() const;
|
||||
|
||||
// glEnable(GL_TEXTURE_(2D|EXTERNAL_OES))
|
||||
void enableTextureTarget(GLenum target);
|
||||
|
||||
// glDisable(GL_TEXTURE_(2D|EXTERNAL_OES))
|
||||
void disableTextureTarget(GLenum target);
|
||||
|
||||
// Implements the target priority logic:
|
||||
// * Return GL_TEXTURE_EXTERNAL_OES if enabled, else
|
||||
// * Return GL_TEXTURE_2D if enabled, else
|
||||
// * Return the allDisabled value.
|
||||
// For some cases passing GL_TEXTURE_2D for allDisabled makes callee code
|
||||
// simpler; for other cases passing a recognizable enum like GL_ZERO or
|
||||
// GL_INVALID_ENUM is appropriate.
|
||||
GLenum getPriorityEnabledTarget(GLenum allDisabled) const;
|
||||
|
||||
// glBindTexture(GL_TEXTURE_*, ...)
|
||||
// Set the target binding of the active texture unit to texture. Returns
|
||||
// GL_NO_ERROR on success or GL_INVALID_OPERATION if the texture has
|
||||
// previously been bound to a different target. If firstUse is not NULL,
|
||||
// it is set to indicate whether this is the first use of the texture.
|
||||
// For accurate error detection, bindTexture should be called for *all*
|
||||
// targets, not just 2D and EXTERNAL_OES.
|
||||
GLenum bindTexture(GLenum target, GLuint texture, GLboolean* firstUse);
|
||||
|
||||
// Return the texture currently bound to GL_TEXTURE_(2D|EXTERNAL_OES).
|
||||
GLuint getBoundTexture(GLenum target) const;
|
||||
|
||||
// glDeleteTextures(...)
|
||||
// Remove references to the to-be-deleted textures.
|
||||
void deleteTextures(GLsizei n, const GLuint* textures);
|
||||
|
||||
private:
|
||||
PixelStoreState m_pixelStore;
|
||||
VertexAttribState *m_states;
|
||||
int m_nLocations;
|
||||
GLuint m_currentArrayVbo;
|
||||
GLuint m_currentIndexVbo;
|
||||
int m_activeTexture;
|
||||
GLint m_currentProgram;
|
||||
|
||||
bool validLocation(int location) { return (location >= 0 && location < m_nLocations); }
|
||||
|
||||
enum TextureTarget {
|
||||
TEXTURE_2D = 0,
|
||||
TEXTURE_EXTERNAL = 1,
|
||||
TEXTURE_TARGET_COUNT
|
||||
};
|
||||
struct TextureUnit {
|
||||
unsigned int enables;
|
||||
GLuint texture[TEXTURE_TARGET_COUNT];
|
||||
};
|
||||
struct TextureRec {
|
||||
GLuint id;
|
||||
GLenum target;
|
||||
};
|
||||
struct TextureState {
|
||||
TextureUnit unit[MAX_TEXTURE_UNITS];
|
||||
TextureUnit* activeUnit;
|
||||
TextureRec* textures;
|
||||
GLuint numTextures;
|
||||
GLuint allocTextures;
|
||||
};
|
||||
TextureState m_tex;
|
||||
|
||||
static int compareTexId(const void* pid, const void* prec);
|
||||
TextureRec* addTextureRec(GLuint id, GLenum target);
|
||||
|
||||
public:
|
||||
void getClientStatePointer(GLenum pname, GLvoid** params);
|
||||
|
||||
template <class T>
|
||||
int getVertexAttribParameter(GLuint index, GLenum param, T *ptr)
|
||||
{
|
||||
bool handled = true;
|
||||
const VertexAttribState *vertexAttrib = getState(index);
|
||||
if (vertexAttrib == NULL) {
|
||||
ERR("getVeterxAttriParameter for non existant index %d\n", index);
|
||||
// set gl error;
|
||||
return handled;
|
||||
}
|
||||
|
||||
switch(param) {
|
||||
case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
|
||||
*ptr = (T)(vertexAttrib->bufferObject);
|
||||
break;
|
||||
case GL_VERTEX_ATTRIB_ARRAY_ENABLED:
|
||||
*ptr = (T)(vertexAttrib->enabled);
|
||||
break;
|
||||
case GL_VERTEX_ATTRIB_ARRAY_SIZE:
|
||||
*ptr = (T)(vertexAttrib->size);
|
||||
break;
|
||||
case GL_VERTEX_ATTRIB_ARRAY_STRIDE:
|
||||
*ptr = (T)(vertexAttrib->stride);
|
||||
break;
|
||||
case GL_VERTEX_ATTRIB_ARRAY_TYPE:
|
||||
*ptr = (T)(vertexAttrib->type);
|
||||
break;
|
||||
case GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:
|
||||
*ptr = (T)(vertexAttrib->normalized);
|
||||
break;
|
||||
case GL_CURRENT_VERTEX_ATTRIB:
|
||||
handled = false;
|
||||
break;
|
||||
default:
|
||||
handled = false;
|
||||
ERR("unknown vertex-attrib parameter param %d\n", param);
|
||||
}
|
||||
return handled;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool getClientStateParameter(GLenum param, T* ptr)
|
||||
{
|
||||
bool isClientStateParam = false;
|
||||
switch (param) {
|
||||
case GL_CLIENT_ACTIVE_TEXTURE: {
|
||||
GLint tex = getActiveTexture() + GL_TEXTURE0;
|
||||
*ptr = tex;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_VERTEX_ARRAY_SIZE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
|
||||
*ptr = state->size;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_VERTEX_ARRAY_TYPE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
|
||||
*ptr = state->type;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_VERTEX_ARRAY_STRIDE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
|
||||
*ptr = state->stride;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_COLOR_ARRAY_SIZE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
|
||||
*ptr = state->size;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_COLOR_ARRAY_TYPE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
|
||||
*ptr = state->type;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_COLOR_ARRAY_STRIDE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
|
||||
*ptr = state->stride;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_NORMAL_ARRAY_TYPE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::NORMAL_LOCATION);
|
||||
*ptr = state->type;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_NORMAL_ARRAY_STRIDE: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::NORMAL_LOCATION);
|
||||
*ptr = state->stride;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_TEXTURE_COORD_ARRAY_SIZE: {
|
||||
const GLClientState::VertexAttribState *state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
|
||||
*ptr = state->size;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_TEXTURE_COORD_ARRAY_TYPE: {
|
||||
const GLClientState::VertexAttribState *state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
|
||||
*ptr = state->type;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_TEXTURE_COORD_ARRAY_STRIDE: {
|
||||
const GLClientState::VertexAttribState *state = getState(getActiveTexture() + GLClientState::TEXCOORD0_LOCATION);
|
||||
*ptr = state->stride;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_POINT_SIZE_ARRAY_TYPE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::POINTSIZE_LOCATION);
|
||||
*ptr = state->type;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_POINT_SIZE_ARRAY_STRIDE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::POINTSIZE_LOCATION);
|
||||
*ptr = state->stride;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_MATRIX_INDEX_ARRAY_SIZE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
|
||||
*ptr = state->size;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_MATRIX_INDEX_ARRAY_TYPE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
|
||||
*ptr = state->type;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_MATRIX_INDEX_ARRAY_STRIDE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
|
||||
*ptr = state->stride;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_WEIGHT_ARRAY_SIZE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
|
||||
*ptr = state->size;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_WEIGHT_ARRAY_TYPE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
|
||||
*ptr = state->type;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_WEIGHT_ARRAY_STRIDE_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
|
||||
*ptr = state->stride;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_VERTEX_ARRAY_BUFFER_BINDING: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::VERTEX_LOCATION);
|
||||
*ptr = state->bufferObject;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_NORMAL_ARRAY_BUFFER_BINDING: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::NORMAL_LOCATION);
|
||||
*ptr = state->bufferObject;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_COLOR_ARRAY_BUFFER_BINDING: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::COLOR_LOCATION);
|
||||
*ptr = state->bufferObject;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING: {
|
||||
const GLClientState::VertexAttribState *state = getState(getActiveTexture()+GLClientState::TEXCOORD0_LOCATION);
|
||||
*ptr = state->bufferObject;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::POINTSIZE_LOCATION);
|
||||
*ptr = state->bufferObject;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::MATRIXINDEX_LOCATION);
|
||||
*ptr = state->bufferObject;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES: {
|
||||
const GLClientState::VertexAttribState *state = getState(GLClientState::WEIGHT_LOCATION);
|
||||
*ptr = state->bufferObject;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_ARRAY_BUFFER_BINDING: {
|
||||
int buffer = getBuffer(GL_ARRAY_BUFFER);
|
||||
*ptr = buffer;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
case GL_ELEMENT_ARRAY_BUFFER_BINDING: {
|
||||
int buffer = getBuffer(GL_ELEMENT_ARRAY_BUFFER);
|
||||
*ptr = buffer;
|
||||
isClientStateParam = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return isClientStateParam;
|
||||
}
|
||||
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _GL_DECODER_CONTEXT_DATA_H_
|
||||
#define _GL_DECODER_CONTEXT_DATA_H_
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include "FixedBuffer.h"
|
||||
#include "codec_defs.h"
|
||||
|
||||
class GLDecoderContextData {
|
||||
public:
|
||||
typedef enum {
|
||||
VERTEX_LOCATION = 0,
|
||||
NORMAL_LOCATION = 1,
|
||||
COLOR_LOCATION = 2,
|
||||
POINTSIZE_LOCATION = 3,
|
||||
TEXCOORD0_LOCATION = 4,
|
||||
TEXCOORD1_LOCATION = 5,
|
||||
TEXCOORD2_LOCATION = 6,
|
||||
TEXCOORD3_LOCATION = 7,
|
||||
TEXCOORD4_LOCATION = 8,
|
||||
TEXCOORD5_LOCATION = 9,
|
||||
TEXCOORD6_LOCATION = 10,
|
||||
TEXCOORD7_LOCATION = 11,
|
||||
MATRIXINDEX_LOCATION = 12,
|
||||
WEIGHT_LOCATION = 13,
|
||||
LAST_LOCATION = 14
|
||||
} PointerDataLocation;
|
||||
|
||||
GLDecoderContextData(int nLocations = CODEC_MAX_VERTEX_ATTRIBUTES) :
|
||||
m_nLocations(nLocations)
|
||||
{
|
||||
m_pointerData = new FixedBuffer[m_nLocations];
|
||||
}
|
||||
|
||||
~GLDecoderContextData() {
|
||||
delete [] m_pointerData;
|
||||
}
|
||||
|
||||
void storePointerData(unsigned int loc, void *data, size_t len) {
|
||||
|
||||
assert(loc < m_nLocations);
|
||||
m_pointerData[loc].alloc(len);
|
||||
memcpy(m_pointerData[loc].ptr(), data, len);
|
||||
}
|
||||
void *pointerData(unsigned int loc) {
|
||||
assert(loc < m_nLocations);
|
||||
return m_pointerData[loc].ptr();
|
||||
}
|
||||
private:
|
||||
FixedBuffer *m_pointerData;
|
||||
int m_nLocations;
|
||||
};
|
||||
|
||||
#endif
|
||||
34
tools/emulator/opengl/shared/OpenglCodecCommon/GLErrorLog.h
Normal file
34
tools/emulator/opengl/shared/OpenglCodecCommon/GLErrorLog.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __GL_ERROR_LOG_H__
|
||||
#define __GL_ERROR_LOG_H__
|
||||
|
||||
#include "ErrorLog.h"
|
||||
|
||||
#ifdef CHECK_GL_ERROR
|
||||
void dbg(){}
|
||||
#define GET_GL_ERROR(gl) \
|
||||
{ \
|
||||
int err = gl.glGetError(); \
|
||||
if (err) { dbg(); ERR("Error: 0x%X in %s (%s:%d)\n", err, __FUNCTION__, __FILE__, __LINE__); } \
|
||||
}
|
||||
|
||||
#else
|
||||
#define GET_GL_ERROR(gl)
|
||||
#endif
|
||||
|
||||
#endif //__GL_ERROR_LOG_H__
|
||||
469
tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp
Normal file
469
tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp
Normal file
@@ -0,0 +1,469 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "GLSharedGroup.h"
|
||||
|
||||
/**** BufferData ****/
|
||||
|
||||
BufferData::BufferData() : m_size(0) {};
|
||||
BufferData::BufferData(GLsizeiptr size, void * data) : m_size(size)
|
||||
{
|
||||
void * buffer = NULL;
|
||||
if (size>0) buffer = m_fixedBuffer.alloc(size);
|
||||
if (data) memcpy(buffer, data, size);
|
||||
}
|
||||
|
||||
/**** ProgramData ****/
|
||||
ProgramData::ProgramData() : m_numIndexes(0),
|
||||
m_initialized(false),
|
||||
m_locShiftWAR(false)
|
||||
{
|
||||
m_Indexes = NULL;
|
||||
}
|
||||
|
||||
void ProgramData::initProgramData(GLuint numIndexes)
|
||||
{
|
||||
m_initialized = true;
|
||||
m_numIndexes = numIndexes;
|
||||
delete[] m_Indexes;
|
||||
m_Indexes = new IndexInfo[numIndexes];
|
||||
m_locShiftWAR = false;
|
||||
}
|
||||
|
||||
bool ProgramData::isInitialized()
|
||||
{
|
||||
return m_initialized;
|
||||
}
|
||||
|
||||
ProgramData::~ProgramData()
|
||||
{
|
||||
delete[] m_Indexes;
|
||||
m_Indexes = NULL;
|
||||
}
|
||||
|
||||
void ProgramData::setIndexInfo(GLuint index, GLint base, GLint size, GLenum type)
|
||||
{
|
||||
if (index>=m_numIndexes)
|
||||
return;
|
||||
m_Indexes[index].base = base;
|
||||
m_Indexes[index].size = size;
|
||||
m_Indexes[index].type = type;
|
||||
if (index > 0) {
|
||||
m_Indexes[index].appBase = m_Indexes[index-1].appBase +
|
||||
m_Indexes[index-1].size;
|
||||
}
|
||||
else {
|
||||
m_Indexes[index].appBase = 0;
|
||||
}
|
||||
m_Indexes[index].hostLocsPerElement = 1;
|
||||
m_Indexes[index].flags = 0;
|
||||
m_Indexes[index].samplerValue = 0;
|
||||
}
|
||||
|
||||
void ProgramData::setIndexFlags(GLuint index, GLuint flags)
|
||||
{
|
||||
if (index >= m_numIndexes)
|
||||
return;
|
||||
m_Indexes[index].flags |= flags;
|
||||
}
|
||||
|
||||
GLuint ProgramData::getIndexForLocation(GLint location)
|
||||
{
|
||||
GLuint index = m_numIndexes;
|
||||
GLint minDist = -1;
|
||||
for (GLuint i=0;i<m_numIndexes;++i)
|
||||
{
|
||||
GLint dist = location - m_Indexes[i].base;
|
||||
if (dist >= 0 &&
|
||||
(minDist < 0 || dist < minDist)) {
|
||||
index = i;
|
||||
minDist = dist;
|
||||
}
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
GLenum ProgramData::getTypeForLocation(GLint location)
|
||||
{
|
||||
GLuint index = getIndexForLocation(location);
|
||||
if (index<m_numIndexes) {
|
||||
return m_Indexes[index].type;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ProgramData::setupLocationShiftWAR()
|
||||
{
|
||||
m_locShiftWAR = false;
|
||||
for (GLuint i=0; i<m_numIndexes; i++) {
|
||||
if (0 != (m_Indexes[i].base & 0xffff)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if we have one uniform at location 0, we do not need the WAR.
|
||||
if (m_numIndexes > 1) {
|
||||
m_locShiftWAR = true;
|
||||
}
|
||||
}
|
||||
|
||||
GLint ProgramData::locationWARHostToApp(GLint hostLoc, GLint arrIndex)
|
||||
{
|
||||
if (!m_locShiftWAR) return hostLoc;
|
||||
|
||||
GLuint index = getIndexForLocation(hostLoc);
|
||||
if (index<m_numIndexes) {
|
||||
if (arrIndex > 0) {
|
||||
m_Indexes[index].hostLocsPerElement =
|
||||
(hostLoc - m_Indexes[index].base) / arrIndex;
|
||||
}
|
||||
return m_Indexes[index].appBase + arrIndex;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
GLint ProgramData::locationWARAppToHost(GLint appLoc)
|
||||
{
|
||||
if (!m_locShiftWAR) return appLoc;
|
||||
|
||||
for(GLuint i=0; i<m_numIndexes; i++) {
|
||||
GLint elemIndex = appLoc - m_Indexes[i].appBase;
|
||||
if (elemIndex >= 0 && elemIndex < m_Indexes[i].size) {
|
||||
return m_Indexes[i].base +
|
||||
elemIndex * m_Indexes[i].hostLocsPerElement;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
GLint ProgramData::getNextSamplerUniform(GLint index, GLint* val, GLenum* target)
|
||||
{
|
||||
for (GLint i = index + 1; i >= 0 && i < (GLint)m_numIndexes; i++) {
|
||||
if (m_Indexes[i].type == GL_SAMPLER_2D) {
|
||||
if (val) *val = m_Indexes[i].samplerValue;
|
||||
if (target) {
|
||||
if (m_Indexes[i].flags & INDEX_FLAG_SAMPLER_EXTERNAL) {
|
||||
*target = GL_TEXTURE_EXTERNAL_OES;
|
||||
} else {
|
||||
*target = GL_TEXTURE_2D;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool ProgramData::setSamplerUniform(GLint appLoc, GLint val, GLenum* target)
|
||||
{
|
||||
for (GLuint i = 0; i < m_numIndexes; i++) {
|
||||
GLint elemIndex = appLoc - m_Indexes[i].appBase;
|
||||
if (elemIndex >= 0 && elemIndex < m_Indexes[i].size) {
|
||||
if (m_Indexes[i].type == GL_TEXTURE_2D) {
|
||||
m_Indexes[i].samplerValue = val;
|
||||
if (target) {
|
||||
if (m_Indexes[i].flags & INDEX_FLAG_SAMPLER_EXTERNAL) {
|
||||
*target = GL_TEXTURE_EXTERNAL_OES;
|
||||
} else {
|
||||
*target = GL_TEXTURE_2D;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProgramData::attachShader(GLuint shader)
|
||||
{
|
||||
size_t n = m_shaders.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
if (m_shaders[i] == shader) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// AKA m_shaders.push_back(), but that has an ambiguous call to insertAt()
|
||||
// due to the default parameters. This is the desired insertAt() overload.
|
||||
m_shaders.insertAt(shader, m_shaders.size(), 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProgramData::detachShader(GLuint shader)
|
||||
{
|
||||
size_t n = m_shaders.size();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
if (m_shaders[i] == shader) {
|
||||
m_shaders.removeAt(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/***** GLSharedGroup ****/
|
||||
|
||||
GLSharedGroup::GLSharedGroup() :
|
||||
m_buffers(android::DefaultKeyedVector<GLuint, BufferData*>(NULL)),
|
||||
m_programs(android::DefaultKeyedVector<GLuint, ProgramData*>(NULL)),
|
||||
m_shaders(android::DefaultKeyedVector<GLuint, ShaderData*>(NULL))
|
||||
{
|
||||
}
|
||||
|
||||
GLSharedGroup::~GLSharedGroup()
|
||||
{
|
||||
m_buffers.clear();
|
||||
m_programs.clear();
|
||||
}
|
||||
|
||||
BufferData * GLSharedGroup::getBufferData(GLuint bufferId)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
return m_buffers.valueFor(bufferId);
|
||||
}
|
||||
|
||||
void GLSharedGroup::addBufferData(GLuint bufferId, GLsizeiptr size, void * data)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
m_buffers.add(bufferId, new BufferData(size, data));
|
||||
}
|
||||
|
||||
void GLSharedGroup::updateBufferData(GLuint bufferId, GLsizeiptr size, void * data)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
m_buffers.replaceValueFor(bufferId, new BufferData(size, data));
|
||||
}
|
||||
|
||||
GLenum GLSharedGroup::subUpdateBufferData(GLuint bufferId, GLintptr offset, GLsizeiptr size, void * data)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
BufferData * buf = m_buffers.valueFor(bufferId);
|
||||
if ((!buf) || (buf->m_size < offset+size) || (offset < 0) || (size<0)) return GL_INVALID_VALUE;
|
||||
|
||||
//it's safe to update now
|
||||
memcpy((char*)buf->m_fixedBuffer.ptr() + offset, data, size);
|
||||
return GL_NO_ERROR;
|
||||
}
|
||||
|
||||
void GLSharedGroup::deleteBufferData(GLuint bufferId)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
m_buffers.removeItem(bufferId);
|
||||
}
|
||||
|
||||
void GLSharedGroup::addProgramData(GLuint program)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData *pData = m_programs.valueFor(program);
|
||||
if (pData)
|
||||
{
|
||||
m_programs.removeItem(program);
|
||||
delete pData;
|
||||
}
|
||||
|
||||
m_programs.add(program,new ProgramData());
|
||||
}
|
||||
|
||||
void GLSharedGroup::initProgramData(GLuint program, GLuint numIndexes)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData *pData = m_programs.valueFor(program);
|
||||
if (pData)
|
||||
{
|
||||
pData->initProgramData(numIndexes);
|
||||
}
|
||||
}
|
||||
|
||||
bool GLSharedGroup::isProgramInitialized(GLuint program)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
if (pData)
|
||||
{
|
||||
return pData->isInitialized();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void GLSharedGroup::deleteProgramData(GLuint program)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData *pData = m_programs.valueFor(program);
|
||||
if (pData)
|
||||
delete pData;
|
||||
m_programs.removeItem(program);
|
||||
}
|
||||
|
||||
void GLSharedGroup::attachShader(GLuint program, GLuint shader)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* programData = m_programs.valueFor(program);
|
||||
ssize_t idx = m_shaders.indexOfKey(shader);
|
||||
if (programData && idx >= 0) {
|
||||
if (programData->attachShader(shader)) {
|
||||
refShaderDataLocked(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GLSharedGroup::detachShader(GLuint program, GLuint shader)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* programData = m_programs.valueFor(program);
|
||||
ssize_t idx = m_shaders.indexOfKey(shader);
|
||||
if (programData && idx >= 0) {
|
||||
if (programData->detachShader(shader)) {
|
||||
unrefShaderDataLocked(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GLSharedGroup::setProgramIndexInfo(GLuint program, GLuint index, GLint base, GLint size, GLenum type, const char* name)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
if (pData)
|
||||
{
|
||||
pData->setIndexInfo(index,base,size,type);
|
||||
|
||||
if (type == GL_SAMPLER_2D) {
|
||||
size_t n = pData->getNumShaders();
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
GLuint shaderId = pData->getShader(i);
|
||||
ShaderData* shader = m_shaders.valueFor(shaderId);
|
||||
if (!shader) continue;
|
||||
ShaderData::StringList::iterator nameIter = shader->samplerExternalNames.begin();
|
||||
ShaderData::StringList::iterator nameEnd = shader->samplerExternalNames.end();
|
||||
while (nameIter != nameEnd) {
|
||||
if (*nameIter == name) {
|
||||
pData->setIndexFlags(index, ProgramData::INDEX_FLAG_SAMPLER_EXTERNAL);
|
||||
break;
|
||||
}
|
||||
++nameIter;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GLenum GLSharedGroup::getProgramUniformType(GLuint program, GLint location)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
GLenum type=0;
|
||||
if (pData)
|
||||
{
|
||||
type = pData->getTypeForLocation(location);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
bool GLSharedGroup::isProgram(GLuint program)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
return (pData!=NULL);
|
||||
}
|
||||
|
||||
void GLSharedGroup::setupLocationShiftWAR(GLuint program)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
if (pData) pData->setupLocationShiftWAR();
|
||||
}
|
||||
|
||||
GLint GLSharedGroup::locationWARHostToApp(GLuint program, GLint hostLoc, GLint arrIndex)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
if (pData) return pData->locationWARHostToApp(hostLoc, arrIndex);
|
||||
else return hostLoc;
|
||||
}
|
||||
|
||||
GLint GLSharedGroup::locationWARAppToHost(GLuint program, GLint appLoc)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
if (pData) return pData->locationWARAppToHost(appLoc);
|
||||
else return appLoc;
|
||||
}
|
||||
|
||||
bool GLSharedGroup::needUniformLocationWAR(GLuint program)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
if (pData) return pData->needUniformLocationWAR();
|
||||
return false;
|
||||
}
|
||||
|
||||
GLint GLSharedGroup::getNextSamplerUniform(GLuint program, GLint index, GLint* val, GLenum* target) const
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
return pData ? pData->getNextSamplerUniform(index, val, target) : -1;
|
||||
}
|
||||
|
||||
bool GLSharedGroup::setSamplerUniform(GLuint program, GLint appLoc, GLint val, GLenum* target)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ProgramData* pData = m_programs.valueFor(program);
|
||||
return pData ? pData->setSamplerUniform(appLoc, val, target) : false;
|
||||
}
|
||||
|
||||
bool GLSharedGroup::addShaderData(GLuint shader)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ShaderData* data = new ShaderData;
|
||||
if (data) {
|
||||
if (m_shaders.add(shader, data) < 0) {
|
||||
delete data;
|
||||
data = NULL;
|
||||
}
|
||||
data->refcount = 1;
|
||||
}
|
||||
return data != NULL;
|
||||
}
|
||||
|
||||
ShaderData* GLSharedGroup::getShaderData(GLuint shader)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
return m_shaders.valueFor(shader);
|
||||
}
|
||||
|
||||
void GLSharedGroup::unrefShaderData(GLuint shader)
|
||||
{
|
||||
android::AutoMutex _lock(m_lock);
|
||||
ssize_t idx = m_shaders.indexOfKey(shader);
|
||||
if (idx >= 0) {
|
||||
unrefShaderDataLocked(idx);
|
||||
}
|
||||
}
|
||||
|
||||
void GLSharedGroup::refShaderDataLocked(ssize_t shaderIdx)
|
||||
{
|
||||
assert(shaderIdx >= 0 && shaderIdx <= m_shaders.size());
|
||||
ShaderData* data = m_shaders.valueAt(shaderIdx);
|
||||
data->refcount++;
|
||||
}
|
||||
|
||||
void GLSharedGroup::unrefShaderDataLocked(ssize_t shaderIdx)
|
||||
{
|
||||
assert(shaderIdx >= 0 && shaderIdx <= m_shaders.size());
|
||||
ShaderData* data = m_shaders.valueAt(shaderIdx);
|
||||
if (--data->refcount == 0) {
|
||||
delete data;
|
||||
m_shaders.removeItemsAt(shaderIdx);
|
||||
}
|
||||
}
|
||||
143
tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h
Normal file
143
tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.h
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _GL_SHARED_GROUP_H_
|
||||
#define _GL_SHARED_GROUP_H_
|
||||
|
||||
#define GL_API
|
||||
#ifndef ANDROID
|
||||
#define GL_APIENTRY
|
||||
#define GL_APIENTRYP
|
||||
#endif
|
||||
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "ErrorLog.h"
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/List.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/threads.h>
|
||||
#include "FixedBuffer.h"
|
||||
#include "SmartPtr.h"
|
||||
|
||||
struct BufferData {
|
||||
BufferData();
|
||||
BufferData(GLsizeiptr size, void * data);
|
||||
GLsizeiptr m_size;
|
||||
FixedBuffer m_fixedBuffer;
|
||||
};
|
||||
|
||||
class ProgramData {
|
||||
private:
|
||||
typedef struct _IndexInfo {
|
||||
GLint base;
|
||||
GLint size;
|
||||
GLenum type;
|
||||
GLint appBase;
|
||||
GLint hostLocsPerElement;
|
||||
GLuint flags;
|
||||
GLint samplerValue; // only set for sampler uniforms
|
||||
} IndexInfo;
|
||||
|
||||
GLuint m_numIndexes;
|
||||
IndexInfo* m_Indexes;
|
||||
bool m_initialized;
|
||||
bool m_locShiftWAR;
|
||||
|
||||
android::Vector<GLuint> m_shaders;
|
||||
|
||||
public:
|
||||
enum {
|
||||
INDEX_FLAG_SAMPLER_EXTERNAL = 0x00000001,
|
||||
};
|
||||
|
||||
ProgramData();
|
||||
void initProgramData(GLuint numIndexes);
|
||||
bool isInitialized();
|
||||
virtual ~ProgramData();
|
||||
void setIndexInfo(GLuint index, GLint base, GLint size, GLenum type);
|
||||
void setIndexFlags(GLuint index, GLuint flags);
|
||||
GLuint getIndexForLocation(GLint location);
|
||||
GLenum getTypeForLocation(GLint location);
|
||||
|
||||
bool needUniformLocationWAR() const { return m_locShiftWAR; }
|
||||
void setupLocationShiftWAR();
|
||||
GLint locationWARHostToApp(GLint hostLoc, GLint arrIndex);
|
||||
GLint locationWARAppToHost(GLint appLoc);
|
||||
|
||||
GLint getNextSamplerUniform(GLint index, GLint* val, GLenum* target);
|
||||
bool setSamplerUniform(GLint appLoc, GLint val, GLenum* target);
|
||||
|
||||
bool attachShader(GLuint shader);
|
||||
bool detachShader(GLuint shader);
|
||||
size_t getNumShaders() const { return m_shaders.size(); }
|
||||
GLuint getShader(size_t i) const { return m_shaders[i]; }
|
||||
};
|
||||
|
||||
struct ShaderData {
|
||||
typedef android::List<android::String8> StringList;
|
||||
StringList samplerExternalNames;
|
||||
int refcount;
|
||||
};
|
||||
|
||||
class GLSharedGroup {
|
||||
private:
|
||||
android::DefaultKeyedVector<GLuint, BufferData*> m_buffers;
|
||||
android::DefaultKeyedVector<GLuint, ProgramData*> m_programs;
|
||||
android::DefaultKeyedVector<GLuint, ShaderData*> m_shaders;
|
||||
mutable android::Mutex m_lock;
|
||||
|
||||
void refShaderDataLocked(ssize_t shaderIdx);
|
||||
void unrefShaderDataLocked(ssize_t shaderIdx);
|
||||
|
||||
public:
|
||||
GLSharedGroup();
|
||||
~GLSharedGroup();
|
||||
BufferData * getBufferData(GLuint bufferId);
|
||||
void addBufferData(GLuint bufferId, GLsizeiptr size, void * data);
|
||||
void updateBufferData(GLuint bufferId, GLsizeiptr size, void * data);
|
||||
GLenum subUpdateBufferData(GLuint bufferId, GLintptr offset, GLsizeiptr size, void * data);
|
||||
void deleteBufferData(GLuint);
|
||||
|
||||
bool isProgram(GLuint program);
|
||||
bool isProgramInitialized(GLuint program);
|
||||
void addProgramData(GLuint program);
|
||||
void initProgramData(GLuint program, GLuint numIndexes);
|
||||
void attachShader(GLuint program, GLuint shader);
|
||||
void detachShader(GLuint program, GLuint shader);
|
||||
void deleteProgramData(GLuint program);
|
||||
void setProgramIndexInfo(GLuint program, GLuint index, GLint base, GLint size, GLenum type, const char* name);
|
||||
GLenum getProgramUniformType(GLuint program, GLint location);
|
||||
void setupLocationShiftWAR(GLuint program);
|
||||
GLint locationWARHostToApp(GLuint program, GLint hostLoc, GLint arrIndex);
|
||||
GLint locationWARAppToHost(GLuint program, GLint appLoc);
|
||||
bool needUniformLocationWAR(GLuint program);
|
||||
GLint getNextSamplerUniform(GLuint program, GLint index, GLint* val, GLenum* target) const;
|
||||
bool setSamplerUniform(GLuint program, GLint appLoc, GLint val, GLenum* target);
|
||||
|
||||
bool addShaderData(GLuint shader);
|
||||
// caller must hold a reference to the shader as long as it holds the pointer
|
||||
ShaderData* getShaderData(GLuint shader);
|
||||
void unrefShaderData(GLuint shader);
|
||||
};
|
||||
|
||||
typedef SmartPtr<GLSharedGroup> GLSharedGroupPtr;
|
||||
|
||||
#endif //_GL_SHARED_GROUP_H_
|
||||
13
tools/emulator/opengl/shared/OpenglCodecCommon/Makefile
Normal file
13
tools/emulator/opengl/shared/OpenglCodecCommon/Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
ROOT=../..
|
||||
|
||||
include $(ROOT)/make/commondefs
|
||||
|
||||
CXXFILES = TcpStream.cpp GLClientState.cpp glUtils.cpp
|
||||
CXXINCS += -I$(ROOT)/libs/GLESv1 -I$(ROOT)/include
|
||||
|
||||
LIBRARY_NAME = libcodecCommon.a
|
||||
|
||||
include $(COMMONRULES)
|
||||
|
||||
|
||||
167
tools/emulator/opengl/shared/OpenglCodecCommon/SmartPtr.h
Normal file
167
tools/emulator/opengl/shared/OpenglCodecCommon/SmartPtr.h
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __SMART_PTR_H
|
||||
#define __SMART_PTR_H
|
||||
|
||||
#include <cutils/threads.h>
|
||||
#include <cutils/atomic.h>
|
||||
|
||||
template <class T, bool threadSafe = false>
|
||||
class SmartPtr
|
||||
{
|
||||
public:
|
||||
explicit SmartPtr(T* ptr = (T*)NULL) {
|
||||
if (threadSafe) {
|
||||
m_lock = new mutex_t;
|
||||
mutex_init(m_lock);
|
||||
}
|
||||
else m_lock = NULL;
|
||||
|
||||
m_ptr = ptr;
|
||||
if (ptr)
|
||||
m_pRefCount = new int32_t(1);
|
||||
else
|
||||
m_pRefCount = NULL;
|
||||
}
|
||||
|
||||
SmartPtr<T,threadSafe>(const SmartPtr<T,false>& rhs) {
|
||||
if (threadSafe) {
|
||||
m_lock = new mutex_t;
|
||||
mutex_init(m_lock);
|
||||
}
|
||||
else m_lock = NULL;
|
||||
|
||||
m_pRefCount = rhs.m_pRefCount;
|
||||
m_ptr = rhs.m_ptr;
|
||||
use();
|
||||
}
|
||||
|
||||
SmartPtr<T,threadSafe>(SmartPtr<T,true>& rhs) {
|
||||
if (threadSafe) {
|
||||
m_lock = new mutex_t;
|
||||
mutex_init(m_lock);
|
||||
}
|
||||
else m_lock = NULL;
|
||||
|
||||
if (rhs.m_lock) mutex_lock(rhs.m_lock);
|
||||
m_pRefCount = rhs.m_pRefCount;
|
||||
m_ptr = rhs.m_ptr;
|
||||
use();
|
||||
if (rhs.m_lock) mutex_unlock(rhs.m_lock);
|
||||
}
|
||||
|
||||
~SmartPtr() {
|
||||
if (m_lock) mutex_lock(m_lock);
|
||||
release();
|
||||
if (m_lock)
|
||||
{
|
||||
mutex_unlock(m_lock);
|
||||
mutex_destroy(m_lock);
|
||||
delete m_lock;
|
||||
}
|
||||
}
|
||||
|
||||
T* Ptr() const {
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
const T* constPtr() const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
T* operator->() const {
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
T& operator*() const {
|
||||
return *m_ptr;
|
||||
}
|
||||
|
||||
operator void*() const {
|
||||
return (void *)m_ptr;
|
||||
}
|
||||
|
||||
// This gives STL lists something to compare.
|
||||
bool operator <(const SmartPtr<T>& t1) const {
|
||||
return m_ptr < t1.m_ptr;
|
||||
}
|
||||
|
||||
SmartPtr<T,threadSafe>& operator=(const SmartPtr<T,false>& rhs)
|
||||
{
|
||||
if (m_ptr == rhs.m_ptr)
|
||||
return *this;
|
||||
|
||||
if (m_lock) mutex_lock(m_lock);
|
||||
release();
|
||||
m_pRefCount = rhs.m_pRefCount;
|
||||
m_ptr = rhs.m_ptr;
|
||||
use();
|
||||
if (m_lock) mutex_unlock(m_lock);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
SmartPtr<T,threadSafe>& operator=(SmartPtr<T,true>& rhs)
|
||||
{
|
||||
if (m_ptr == rhs.m_ptr)
|
||||
return *this;
|
||||
|
||||
if (m_lock) mutex_lock(m_lock);
|
||||
release();
|
||||
if (rhs.m_lock) mutex_lock(rhs.m_lock);
|
||||
m_pRefCount = rhs.m_pRefCount;
|
||||
m_ptr = rhs.m_ptr;
|
||||
use();
|
||||
if (rhs.m_lock) mutex_unlock(rhs.m_lock);
|
||||
if (m_lock) mutex_unlock(m_lock);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
int32_t *m_pRefCount;
|
||||
mutex_t *m_lock;
|
||||
T* m_ptr;
|
||||
|
||||
// Increment the reference count on this pointer by 1.
|
||||
int use() {
|
||||
if (!m_pRefCount) return 0;
|
||||
return android_atomic_inc(m_pRefCount) + 1;
|
||||
}
|
||||
|
||||
// Decrement the reference count on the pointer by 1.
|
||||
// If the reference count goes to (or below) 0, the pointer is deleted.
|
||||
int release() {
|
||||
if (!m_pRefCount) return 0;
|
||||
|
||||
int iVal = android_atomic_dec(m_pRefCount);
|
||||
if (iVal > 1)
|
||||
return iVal - 1;
|
||||
|
||||
delete m_pRefCount;
|
||||
m_pRefCount = NULL;
|
||||
|
||||
if (m_ptr) {
|
||||
delete m_ptr;
|
||||
m_ptr = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // of __SMART_PTR_H
|
||||
168
tools/emulator/opengl/shared/OpenglCodecCommon/SocketStream.cpp
Normal file
168
tools/emulator/opengl/shared/OpenglCodecCommon/SocketStream.cpp
Normal file
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "SocketStream.h"
|
||||
#include <cutils/sockets.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <sys/un.h>
|
||||
#else
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
SocketStream::SocketStream(size_t bufSize) :
|
||||
IOStream(bufSize),
|
||||
m_sock(-1),
|
||||
m_bufsize(bufSize),
|
||||
m_buf(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
SocketStream::SocketStream(int sock, size_t bufSize) :
|
||||
IOStream(bufSize),
|
||||
m_sock(sock),
|
||||
m_bufsize(bufSize),
|
||||
m_buf(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
SocketStream::~SocketStream()
|
||||
{
|
||||
if (m_sock >= 0) {
|
||||
#ifdef _WIN32
|
||||
closesocket(m_sock);
|
||||
#else
|
||||
::close(m_sock);
|
||||
#endif
|
||||
}
|
||||
if (m_buf != NULL) {
|
||||
free(m_buf);
|
||||
m_buf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void *SocketStream::allocBuffer(size_t minSize)
|
||||
{
|
||||
size_t allocSize = (m_bufsize < minSize ? minSize : m_bufsize);
|
||||
if (!m_buf) {
|
||||
m_buf = (unsigned char *)malloc(allocSize);
|
||||
}
|
||||
else if (m_bufsize < allocSize) {
|
||||
unsigned char *p = (unsigned char *)realloc(m_buf, allocSize);
|
||||
if (p != NULL) {
|
||||
m_buf = p;
|
||||
m_bufsize = allocSize;
|
||||
} else {
|
||||
ERR("%s: realloc (%zu) failed\n", __FUNCTION__, allocSize);
|
||||
free(m_buf);
|
||||
m_buf = NULL;
|
||||
m_bufsize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return m_buf;
|
||||
};
|
||||
|
||||
int SocketStream::commitBuffer(size_t size)
|
||||
{
|
||||
return writeFully(m_buf, size);
|
||||
}
|
||||
|
||||
int SocketStream::writeFully(const void* buffer, size_t size)
|
||||
{
|
||||
if (!valid()) return -1;
|
||||
|
||||
size_t res = size;
|
||||
int retval = 0;
|
||||
|
||||
while (res > 0) {
|
||||
ssize_t stat = ::send(m_sock, (const char *)buffer + (size - res), res, 0);
|
||||
if (stat < 0) {
|
||||
if (errno != EINTR) {
|
||||
retval = stat;
|
||||
ERR("%s: failed: %s\n", __FUNCTION__, strerror(errno));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
res -= stat;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
const unsigned char *SocketStream::readFully(void *buf, size_t len)
|
||||
{
|
||||
const unsigned char* ret = NULL;
|
||||
if (!valid()) return NULL;
|
||||
if (!buf) {
|
||||
return NULL; // do not allow NULL buf in that implementation
|
||||
}
|
||||
size_t res = len;
|
||||
while (res > 0) {
|
||||
ssize_t stat = ::recv(m_sock, (char *)(buf) + len - res, res, 0);
|
||||
if (stat > 0) {
|
||||
res -= stat;
|
||||
continue;
|
||||
}
|
||||
if (stat == 0 || errno != EINTR) { // client shutdown or error
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return (const unsigned char *)buf;
|
||||
}
|
||||
|
||||
const unsigned char *SocketStream::read( void *buf, size_t *inout_len)
|
||||
{
|
||||
if (!valid()) return NULL;
|
||||
if (!buf) {
|
||||
return NULL; // do not allow NULL buf in that implementation
|
||||
}
|
||||
|
||||
int n;
|
||||
do {
|
||||
n = recv(buf, *inout_len);
|
||||
} while( n < 0 && errno == EINTR );
|
||||
|
||||
if (n > 0) {
|
||||
*inout_len = n;
|
||||
return (const unsigned char *)buf;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int SocketStream::recv(void *buf, size_t len)
|
||||
{
|
||||
if (!valid()) return int(ERR_INVALID_SOCKET);
|
||||
int res = 0;
|
||||
while(true) {
|
||||
res = ::recv(m_sock, (char *)buf, len, 0);
|
||||
if (res < 0) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __SOCKET_STREAM_H
|
||||
#define __SOCKET_STREAM_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "IOStream.h"
|
||||
|
||||
class SocketStream : public IOStream {
|
||||
public:
|
||||
typedef enum { ERR_INVALID_SOCKET = -1000 } SocketStreamError;
|
||||
|
||||
explicit SocketStream(size_t bufsize = 10000);
|
||||
virtual ~SocketStream();
|
||||
|
||||
virtual int listen(unsigned short port) = 0;
|
||||
virtual SocketStream *accept() = 0;
|
||||
virtual int connect(unsigned short port) = 0;
|
||||
|
||||
virtual void *allocBuffer(size_t minSize);
|
||||
virtual int commitBuffer(size_t size);
|
||||
virtual const unsigned char *readFully(void *buf, size_t len);
|
||||
virtual const unsigned char *read(void *buf, size_t *inout_len);
|
||||
|
||||
bool valid() { return m_sock >= 0; }
|
||||
virtual int recv(void *buf, size_t len);
|
||||
virtual int writeFully(const void *buf, size_t len);
|
||||
|
||||
protected:
|
||||
int m_sock;
|
||||
size_t m_bufsize;
|
||||
unsigned char *m_buf;
|
||||
|
||||
SocketStream(int sock, size_t bufSize);
|
||||
};
|
||||
|
||||
#endif /* __SOCKET_STREAM_H */
|
||||
91
tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.cpp
Normal file
91
tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.cpp
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "TcpStream.h"
|
||||
#include <cutils/sockets.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#else
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
TcpStream::TcpStream(size_t bufSize) :
|
||||
SocketStream(bufSize)
|
||||
{
|
||||
}
|
||||
|
||||
TcpStream::TcpStream(int sock, size_t bufSize) :
|
||||
SocketStream(sock, bufSize)
|
||||
{
|
||||
// disable Nagle algorithm to improve bandwidth of small
|
||||
// packets which are quite common in our implementation.
|
||||
#ifdef _WIN32
|
||||
DWORD flag;
|
||||
#else
|
||||
int flag;
|
||||
#endif
|
||||
flag = 1;
|
||||
setsockopt( sock, IPPROTO_TCP, TCP_NODELAY, (const char*)&flag, sizeof(flag) );
|
||||
}
|
||||
|
||||
int TcpStream::listen(unsigned short port)
|
||||
{
|
||||
m_sock = socket_loopback_server(port, SOCK_STREAM);
|
||||
if (!valid()) return int(ERR_INVALID_SOCKET);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SocketStream * TcpStream::accept()
|
||||
{
|
||||
int clientSock = -1;
|
||||
|
||||
while (true) {
|
||||
struct sockaddr_in addr;
|
||||
socklen_t len = sizeof(addr);
|
||||
clientSock = ::accept(m_sock, (sockaddr *)&addr, &len);
|
||||
|
||||
if (clientSock < 0 && errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
TcpStream *clientStream = NULL;
|
||||
|
||||
if (clientSock >= 0) {
|
||||
clientStream = new TcpStream(clientSock, m_bufsize);
|
||||
}
|
||||
return clientStream;
|
||||
}
|
||||
|
||||
int TcpStream::connect(unsigned short port)
|
||||
{
|
||||
return connect("127.0.0.1",port);
|
||||
}
|
||||
|
||||
int TcpStream::connect(const char* hostname, unsigned short port)
|
||||
{
|
||||
m_sock = socket_network_client(hostname, port, SOCK_STREAM);
|
||||
if (!valid()) return -1;
|
||||
return 0;
|
||||
}
|
||||
32
tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.h
Normal file
32
tools/emulator/opengl/shared/OpenglCodecCommon/TcpStream.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __TCP_STREAM_H
|
||||
#define __TCP_STREAM_H
|
||||
|
||||
#include "SocketStream.h"
|
||||
|
||||
class TcpStream : public SocketStream {
|
||||
public:
|
||||
explicit TcpStream(size_t bufsize = 10000);
|
||||
virtual int listen(unsigned short port);
|
||||
virtual SocketStream *accept();
|
||||
virtual int connect(unsigned short port);
|
||||
int connect(const char* hostname, unsigned short port);
|
||||
private:
|
||||
TcpStream(int sock, size_t bufSize);
|
||||
};
|
||||
|
||||
#endif
|
||||
69
tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.cpp
Normal file
69
tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "TimeUtils.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#elif defined(__linux__)
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
long long GetCurrentTimeMS()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
static LARGE_INTEGER freq;
|
||||
static bool bNotInit = true;
|
||||
if ( bNotInit ) {
|
||||
bNotInit = (QueryPerformanceFrequency( &freq ) == FALSE);
|
||||
}
|
||||
LARGE_INTEGER currVal;
|
||||
QueryPerformanceCounter( &currVal );
|
||||
|
||||
return currVal.QuadPart / (freq.QuadPart / 1000);
|
||||
|
||||
#elif defined(__linux__)
|
||||
|
||||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
long long iDiff = (now.tv_sec * 1000LL) + now.tv_nsec/1000000LL;
|
||||
return iDiff;
|
||||
|
||||
#else /* Others, e.g. OS X */
|
||||
|
||||
struct timeval now;
|
||||
gettimeofday(&now, NULL);
|
||||
long long iDiff = (now.tv_sec * 1000LL) + now.tv_usec/1000LL;
|
||||
return iDiff;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void TimeSleepMS(int p_mili)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
Sleep(p_mili);
|
||||
#else
|
||||
usleep(p_mili * 1000);
|
||||
#endif
|
||||
}
|
||||
22
tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.h
Normal file
22
tools/emulator/opengl/shared/OpenglCodecCommon/TimeUtils.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _TIME_UTILS_H
|
||||
#define _TIME_UTILS_H
|
||||
|
||||
long long GetCurrentTimeMS();
|
||||
void TimeSleepMS(int p_mili);
|
||||
|
||||
#endif
|
||||
137
tools/emulator/opengl/shared/OpenglCodecCommon/UnixStream.cpp
Normal file
137
tools/emulator/opengl/shared/OpenglCodecCommon/UnixStream.cpp
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "UnixStream.h"
|
||||
#include <cutils/sockets.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* Not all systems define PATH_MAX, those who don't generally don't
|
||||
* have a limit on the maximum path size, so use a value that is
|
||||
* large enough for our very limited needs.
|
||||
*/
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 128
|
||||
#endif
|
||||
|
||||
UnixStream::UnixStream(size_t bufSize) :
|
||||
SocketStream(bufSize)
|
||||
{
|
||||
}
|
||||
|
||||
UnixStream::UnixStream(int sock, size_t bufSize) :
|
||||
SocketStream(sock, bufSize)
|
||||
{
|
||||
}
|
||||
|
||||
/* Initialize a sockaddr_un with the appropriate values corresponding
|
||||
* to a given 'virtual port'. Returns 0 on success, -1 on error.
|
||||
*/
|
||||
static int
|
||||
make_unix_path(char *path, size_t pathlen, int port_number)
|
||||
{
|
||||
char tmp[PATH_MAX]; // temp directory
|
||||
int ret = 0;
|
||||
|
||||
// First, create user-specific temp directory if needed
|
||||
const char* user = getenv("USER");
|
||||
if (user != NULL) {
|
||||
struct stat st;
|
||||
snprintf(tmp, sizeof(tmp), "/tmp/android-%s", user);
|
||||
do {
|
||||
ret = ::lstat(tmp, &st);
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
|
||||
if (ret < 0 && errno == ENOENT) {
|
||||
do {
|
||||
ret = ::mkdir(tmp, 0766);
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
if (ret < 0) {
|
||||
ERR("Could not create temp directory: %s", tmp);
|
||||
user = NULL; // will fall-back to /tmp
|
||||
}
|
||||
}
|
||||
else if (ret < 0) {
|
||||
user = NULL; // will fallback to /tmp
|
||||
}
|
||||
}
|
||||
|
||||
if (user == NULL) { // fallback to /tmp in case of error
|
||||
snprintf(tmp, sizeof(tmp), "/tmp");
|
||||
}
|
||||
|
||||
// Now, initialize it properly
|
||||
snprintf(path, pathlen, "%s/qemu-gles-%d", tmp, port_number);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int UnixStream::listen(unsigned short port)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
|
||||
if (make_unix_path(path, sizeof(path), port) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
m_sock = socket_local_server(path, ANDROID_SOCKET_NAMESPACE_FILESYSTEM, SOCK_STREAM);
|
||||
if (!valid()) return int(ERR_INVALID_SOCKET);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
SocketStream * UnixStream::accept()
|
||||
{
|
||||
int clientSock = -1;
|
||||
|
||||
while (true) {
|
||||
struct sockaddr_un addr;
|
||||
socklen_t len = sizeof(addr);
|
||||
clientSock = ::accept(m_sock, (sockaddr *)&addr, &len);
|
||||
|
||||
if (clientSock < 0 && errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
UnixStream *clientStream = NULL;
|
||||
|
||||
if (clientSock >= 0) {
|
||||
clientStream = new UnixStream(clientSock, m_bufsize);
|
||||
}
|
||||
return clientStream;
|
||||
}
|
||||
|
||||
int UnixStream::connect(unsigned short port)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
|
||||
if (make_unix_path(path, sizeof(path), port) < 0)
|
||||
return -1;
|
||||
|
||||
m_sock = socket_local_client(path, ANDROID_SOCKET_NAMESPACE_FILESYSTEM, SOCK_STREAM);
|
||||
if (!valid()) return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
31
tools/emulator/opengl/shared/OpenglCodecCommon/UnixStream.h
Normal file
31
tools/emulator/opengl/shared/OpenglCodecCommon/UnixStream.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __UNIX_STREAM_H
|
||||
#define __UNIX_STREAM_H
|
||||
|
||||
#include "SocketStream.h"
|
||||
|
||||
class UnixStream : public SocketStream {
|
||||
public:
|
||||
explicit UnixStream(size_t bufsize = 10000);
|
||||
virtual int listen(unsigned short port);
|
||||
virtual SocketStream *accept();
|
||||
virtual int connect(unsigned short port);
|
||||
private:
|
||||
UnixStream(int sock, size_t bufSize);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "Win32PipeStream.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#error ONLY BUILD THIS SOURCE FILE FOR WINDOWS!
|
||||
#endif
|
||||
|
||||
/* The official documentation states that the name of a given named
|
||||
* pipe cannot be more than 256 characters long.
|
||||
*/
|
||||
#define NAMED_PIPE_MAX 256
|
||||
|
||||
Win32PipeStream::Win32PipeStream(size_t bufSize) :
|
||||
SocketStream(bufSize),
|
||||
m_pipe(INVALID_HANDLE_VALUE)
|
||||
{
|
||||
}
|
||||
|
||||
Win32PipeStream::Win32PipeStream(HANDLE pipe, size_t bufSize) :
|
||||
SocketStream(-1, bufSize),
|
||||
m_pipe(pipe)
|
||||
{
|
||||
}
|
||||
|
||||
Win32PipeStream::~Win32PipeStream()
|
||||
{
|
||||
if (m_pipe != INVALID_HANDLE_VALUE) {
|
||||
CloseHandle(m_pipe);
|
||||
m_pipe = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize the pipe name corresponding to a given port
|
||||
*/
|
||||
static void
|
||||
make_pipe_name(char *path, size_t pathlen, int port_number)
|
||||
{
|
||||
snprintf(path, pathlen, "\\\\.\\pipe\\qemu-gles-%d", port_number);
|
||||
}
|
||||
|
||||
|
||||
/* Technical note: Named pipes work differently from BSD Sockets.
|
||||
* One does not create/bind a pipe, and collect a new handle each
|
||||
* time a client connects with accept().
|
||||
*
|
||||
* Instead, the server creates a new pipe instance each time it wants
|
||||
* to get a new client connection, then calls ConnectNamedPipe() to
|
||||
* wait for a connection.
|
||||
*
|
||||
* So listen() is a no-op, and accept() really creates the pipe handle.
|
||||
*
|
||||
* Also, connect() must create a pipe handle with CreateFile() and
|
||||
* wait for a server instance with WaitNamedPipe()
|
||||
*/
|
||||
int Win32PipeStream::listen(unsigned short port)
|
||||
{
|
||||
// just save the port number for accept()
|
||||
m_port = port;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SocketStream * Win32PipeStream::accept()
|
||||
{
|
||||
char path[NAMED_PIPE_MAX+1];
|
||||
SocketStream* clientStream;
|
||||
HANDLE pipe;
|
||||
|
||||
make_pipe_name(path, sizeof(path), m_port);
|
||||
|
||||
pipe = ::CreateNamedPipe(
|
||||
path, // pipe name
|
||||
PIPE_ACCESS_DUPLEX, // read-write access
|
||||
PIPE_TYPE_BYTE | // byte-oriented writes
|
||||
PIPE_READMODE_BYTE | // byte-oriented reads
|
||||
PIPE_WAIT, // blocking operations
|
||||
PIPE_UNLIMITED_INSTANCES, // no limit on clients
|
||||
4096, // input buffer size
|
||||
4096, // output buffer size
|
||||
0, // client time-out
|
||||
NULL); // default security attributes
|
||||
|
||||
if (pipe == INVALID_HANDLE_VALUE) {
|
||||
ERR("%s: CreateNamedPipe failed %d\n", __FUNCTION__, (int)GetLastError());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Stupid Win32 API design: If a client is already connected, then
|
||||
// ConnectNamedPipe will return 0, and GetLastError() will return
|
||||
// ERROR_PIPE_CONNECTED. This is not an error! It just means that the
|
||||
// function didn't have to wait.
|
||||
//
|
||||
if (::ConnectNamedPipe(pipe, NULL) == 0 && GetLastError() != ERROR_PIPE_CONNECTED) {
|
||||
ERR("%s: ConnectNamedPipe failed: %d\n", __FUNCTION__, (int)GetLastError());
|
||||
CloseHandle(pipe);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
clientStream = new Win32PipeStream(pipe, m_bufsize);
|
||||
return clientStream;
|
||||
}
|
||||
|
||||
int Win32PipeStream::connect(unsigned short port)
|
||||
{
|
||||
char path[NAMED_PIPE_MAX+1];
|
||||
HANDLE pipe;
|
||||
int tries = 10;
|
||||
|
||||
make_pipe_name(path, sizeof(path), port);
|
||||
|
||||
/* We're going to loop in order to wait for the pipe server to
|
||||
* be setup properly.
|
||||
*/
|
||||
for (; tries > 0; tries--) {
|
||||
pipe = ::CreateFile(
|
||||
path, // pipe name
|
||||
GENERIC_READ | GENERIC_WRITE, // read & write
|
||||
0, // no sharing
|
||||
NULL, // default security attrs
|
||||
OPEN_EXISTING, // open existing pipe
|
||||
0, // default attributes
|
||||
NULL); // no template file
|
||||
|
||||
/* If we have a valid pipe handle, break from the loop */
|
||||
if (pipe != INVALID_HANDLE_VALUE) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* We can get here if the pipe is busy, i.e. if the server hasn't
|
||||
* create a new pipe instance to service our request. In which case
|
||||
* GetLastError() will return ERROR_PIPE_BUSY.
|
||||
*
|
||||
* If so, then use WaitNamedPipe() to wait for a decent time
|
||||
* to try again.
|
||||
*/
|
||||
if (GetLastError() != ERROR_PIPE_BUSY) {
|
||||
/* Not ERROR_PIPE_BUSY */
|
||||
ERR("%s: CreateFile failed: %d\n", __FUNCTION__, (int)GetLastError());
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Wait for 5 seconds */
|
||||
if ( !WaitNamedPipe(path, 5000) ) {
|
||||
ERR("%s: WaitNamedPipe failed: %d\n", __FUNCTION__, (int)GetLastError());
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
m_pipe = pipe;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Special buffer methods, since we can't use socket functions here */
|
||||
|
||||
int Win32PipeStream::commitBuffer(size_t size)
|
||||
{
|
||||
if (m_pipe == INVALID_HANDLE_VALUE)
|
||||
return -1;
|
||||
|
||||
size_t res = size;
|
||||
int retval = 0;
|
||||
|
||||
while (res > 0) {
|
||||
DWORD written;
|
||||
if (! ::WriteFile(m_pipe, (const char *)m_buf + (size - res), res, &written, NULL)) {
|
||||
retval = -1;
|
||||
ERR("%s: failed: %d\n", __FUNCTION__, (int)GetLastError());
|
||||
break;
|
||||
}
|
||||
res -= written;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
const unsigned char *Win32PipeStream::readFully(void *buf, size_t len)
|
||||
{
|
||||
const unsigned char* ret = NULL;
|
||||
|
||||
if (m_pipe == INVALID_HANDLE_VALUE)
|
||||
return NULL;
|
||||
|
||||
if (!buf) {
|
||||
return NULL; // do not allow NULL buf in that implementation
|
||||
}
|
||||
|
||||
size_t res = len;
|
||||
while (res > 0) {
|
||||
DWORD readcount = 0;
|
||||
if (! ::ReadFile(m_pipe, (char *)buf + (len - res), res, &readcount, NULL) || readcount == 0) {
|
||||
errno = (int)GetLastError();
|
||||
return NULL;
|
||||
}
|
||||
res -= readcount;
|
||||
}
|
||||
return (const unsigned char *)buf;
|
||||
}
|
||||
|
||||
const unsigned char *Win32PipeStream::read( void *buf, size_t *inout_len)
|
||||
{
|
||||
size_t len = *inout_len;
|
||||
DWORD readcount;
|
||||
|
||||
if (m_pipe == INVALID_HANDLE_VALUE)
|
||||
return NULL;
|
||||
|
||||
if (!buf) {
|
||||
return NULL; // do not allow NULL buf in that implementation
|
||||
}
|
||||
|
||||
if (!::ReadFile(m_pipe, (char *)buf, len, &readcount, NULL)) {
|
||||
errno = (int)GetLastError();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*inout_len = (size_t)readcount;
|
||||
return (const unsigned char *)buf;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __WIN32_PIPE_STREAM_H
|
||||
#define __WIN32_PIPE_STREAM_H
|
||||
|
||||
#include "SocketStream.h"
|
||||
#include <windows.h>
|
||||
|
||||
class Win32PipeStream : public SocketStream {
|
||||
public:
|
||||
explicit Win32PipeStream(size_t bufsize = 10000);
|
||||
virtual ~Win32PipeStream();
|
||||
virtual int listen(unsigned short port);
|
||||
virtual SocketStream *accept();
|
||||
virtual int connect(unsigned short port);
|
||||
|
||||
virtual int commitBuffer(size_t size);
|
||||
virtual const unsigned char *readFully(void *buf, size_t len);
|
||||
virtual const unsigned char *read(void *buf, size_t *inout_len);
|
||||
|
||||
private:
|
||||
Win32PipeStream(HANDLE pipe, size_t bufSize);
|
||||
HANDLE m_pipe;
|
||||
int m_port;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
23
tools/emulator/opengl/shared/OpenglCodecCommon/codec_defs.h
Normal file
23
tools/emulator/opengl/shared/OpenglCodecCommon/codec_defs.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _CODEC_DEFS_H
|
||||
#define _CODEC_DEFS_H
|
||||
|
||||
#define CODEC_SERVER_PORT 22468
|
||||
|
||||
#define CODEC_MAX_VERTEX_ATTRIBUTES 64
|
||||
|
||||
#endif
|
||||
471
tools/emulator/opengl/shared/OpenglCodecCommon/glUtils.cpp
Normal file
471
tools/emulator/opengl/shared/OpenglCodecCommon/glUtils.cpp
Normal file
@@ -0,0 +1,471 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "glUtils.h"
|
||||
#include <string.h>
|
||||
#include "ErrorLog.h"
|
||||
#include <IOStream.h>
|
||||
|
||||
size_t glSizeof(GLenum type)
|
||||
{
|
||||
size_t retval = 0;
|
||||
switch(type) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
retval = 1;
|
||||
break;
|
||||
case GL_SHORT:
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_HALF_FLOAT_OES:
|
||||
retval = 2;
|
||||
break;
|
||||
case GL_INT:
|
||||
case GL_FLOAT:
|
||||
case GL_FIXED:
|
||||
case GL_BOOL:
|
||||
retval = 4;
|
||||
break;
|
||||
#ifdef GL_DOUBLE
|
||||
case GL_DOUBLE:
|
||||
retval = 8;
|
||||
break;
|
||||
#endif
|
||||
case GL_FLOAT_VEC2:
|
||||
case GL_INT_VEC2:
|
||||
case GL_BOOL_VEC2:
|
||||
retval = 8;
|
||||
break;
|
||||
case GL_INT_VEC3:
|
||||
case GL_BOOL_VEC3:
|
||||
case GL_FLOAT_VEC3:
|
||||
retval = 12;
|
||||
break;
|
||||
case GL_FLOAT_VEC4:
|
||||
case GL_BOOL_VEC4:
|
||||
case GL_INT_VEC4:
|
||||
case GL_FLOAT_MAT2:
|
||||
retval = 16;
|
||||
break;
|
||||
case GL_FLOAT_MAT3:
|
||||
retval = 36;
|
||||
break;
|
||||
case GL_FLOAT_MAT4:
|
||||
retval = 64;
|
||||
break;
|
||||
case GL_SAMPLER_2D:
|
||||
case GL_SAMPLER_CUBE:
|
||||
retval = 4;
|
||||
break;
|
||||
default:
|
||||
ERR("**** ERROR unknown type 0x%x (%s,%d)\n", type, __FUNCTION__,__LINE__);
|
||||
}
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
size_t glUtilsParamSize(GLenum param)
|
||||
{
|
||||
size_t s = 0;
|
||||
|
||||
switch(param)
|
||||
{
|
||||
case GL_DEPTH_TEST:
|
||||
case GL_DEPTH_FUNC:
|
||||
case GL_DEPTH_BITS:
|
||||
case GL_MAX_CLIP_PLANES:
|
||||
case GL_GREEN_BITS:
|
||||
case GL_MAX_MODELVIEW_STACK_DEPTH:
|
||||
case GL_MAX_PROJECTION_STACK_DEPTH:
|
||||
case GL_MAX_TEXTURE_STACK_DEPTH:
|
||||
case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
|
||||
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
|
||||
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
|
||||
case GL_MAX_TEXTURE_SIZE:
|
||||
case GL_TEXTURE_GEN_MODE_OES:
|
||||
case GL_TEXTURE_ENV_MODE:
|
||||
case GL_FOG_MODE:
|
||||
case GL_FOG_DENSITY:
|
||||
case GL_FOG_START:
|
||||
case GL_FOG_END:
|
||||
case GL_SPOT_EXPONENT:
|
||||
case GL_CONSTANT_ATTENUATION:
|
||||
case GL_LINEAR_ATTENUATION:
|
||||
case GL_QUADRATIC_ATTENUATION:
|
||||
case GL_SHININESS:
|
||||
case GL_LIGHT_MODEL_TWO_SIDE:
|
||||
case GL_POINT_SIZE:
|
||||
case GL_POINT_SIZE_MIN:
|
||||
case GL_POINT_SIZE_MAX:
|
||||
case GL_POINT_FADE_THRESHOLD_SIZE:
|
||||
case GL_CULL_FACE_MODE:
|
||||
case GL_FRONT_FACE:
|
||||
case GL_SHADE_MODEL:
|
||||
case GL_DEPTH_WRITEMASK:
|
||||
case GL_DEPTH_CLEAR_VALUE:
|
||||
case GL_STENCIL_FAIL:
|
||||
case GL_STENCIL_PASS_DEPTH_FAIL:
|
||||
case GL_STENCIL_PASS_DEPTH_PASS:
|
||||
case GL_STENCIL_REF:
|
||||
case GL_STENCIL_WRITEMASK:
|
||||
case GL_MATRIX_MODE:
|
||||
case GL_MODELVIEW_STACK_DEPTH:
|
||||
case GL_PROJECTION_STACK_DEPTH:
|
||||
case GL_TEXTURE_STACK_DEPTH:
|
||||
case GL_ALPHA_TEST_FUNC:
|
||||
case GL_ALPHA_TEST_REF:
|
||||
case GL_ALPHA_TEST:
|
||||
case GL_BLEND_DST:
|
||||
case GL_BLEND_SRC:
|
||||
case GL_BLEND:
|
||||
case GL_LOGIC_OP_MODE:
|
||||
case GL_SCISSOR_TEST:
|
||||
case GL_MAX_TEXTURE_UNITS:
|
||||
case GL_ACTIVE_TEXTURE:
|
||||
case GL_ALPHA_BITS:
|
||||
case GL_ARRAY_BUFFER_BINDING:
|
||||
case GL_BLUE_BITS:
|
||||
case GL_CLIENT_ACTIVE_TEXTURE:
|
||||
case GL_CLIP_PLANE0:
|
||||
case GL_CLIP_PLANE1:
|
||||
case GL_CLIP_PLANE2:
|
||||
case GL_CLIP_PLANE3:
|
||||
case GL_CLIP_PLANE4:
|
||||
case GL_CLIP_PLANE5:
|
||||
case GL_COLOR_ARRAY:
|
||||
case GL_COLOR_ARRAY_BUFFER_BINDING:
|
||||
case GL_COLOR_ARRAY_SIZE:
|
||||
case GL_COLOR_ARRAY_STRIDE:
|
||||
case GL_COLOR_ARRAY_TYPE:
|
||||
case GL_COLOR_LOGIC_OP:
|
||||
case GL_COLOR_MATERIAL:
|
||||
case GL_PACK_ALIGNMENT:
|
||||
case GL_PERSPECTIVE_CORRECTION_HINT:
|
||||
case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
|
||||
case GL_POINT_SIZE_ARRAY_STRIDE_OES:
|
||||
case GL_POINT_SIZE_ARRAY_TYPE_OES:
|
||||
case GL_POINT_SMOOTH:
|
||||
case GL_POINT_SMOOTH_HINT:
|
||||
case GL_POINT_SPRITE_OES:
|
||||
case GL_COORD_REPLACE_OES:
|
||||
case GL_COMBINE_ALPHA:
|
||||
case GL_SRC0_RGB:
|
||||
case GL_SRC1_RGB:
|
||||
case GL_SRC2_RGB:
|
||||
case GL_OPERAND0_RGB:
|
||||
case GL_OPERAND1_RGB:
|
||||
case GL_OPERAND2_RGB:
|
||||
case GL_SRC0_ALPHA:
|
||||
case GL_SRC1_ALPHA:
|
||||
case GL_SRC2_ALPHA:
|
||||
case GL_OPERAND0_ALPHA:
|
||||
case GL_OPERAND1_ALPHA:
|
||||
case GL_OPERAND2_ALPHA:
|
||||
case GL_RGB_SCALE:
|
||||
case GL_ALPHA_SCALE:
|
||||
case GL_COMBINE_RGB:
|
||||
case GL_POLYGON_OFFSET_FACTOR:
|
||||
case GL_POLYGON_OFFSET_FILL:
|
||||
case GL_POLYGON_OFFSET_UNITS:
|
||||
case GL_RED_BITS:
|
||||
case GL_RESCALE_NORMAL:
|
||||
case GL_SAMPLE_ALPHA_TO_COVERAGE:
|
||||
case GL_SAMPLE_ALPHA_TO_ONE:
|
||||
case GL_SAMPLE_BUFFERS:
|
||||
case GL_SAMPLE_COVERAGE:
|
||||
case GL_SAMPLE_COVERAGE_INVERT:
|
||||
case GL_SAMPLE_COVERAGE_VALUE:
|
||||
case GL_SAMPLES:
|
||||
case GL_STENCIL_BITS:
|
||||
case GL_STENCIL_CLEAR_VALUE:
|
||||
case GL_STENCIL_FUNC:
|
||||
case GL_STENCIL_TEST:
|
||||
case GL_STENCIL_VALUE_MASK:
|
||||
case GL_STENCIL_BACK_FUNC:
|
||||
case GL_STENCIL_BACK_VALUE_MASK:
|
||||
case GL_STENCIL_BACK_REF:
|
||||
case GL_STENCIL_BACK_FAIL:
|
||||
case GL_STENCIL_BACK_PASS_DEPTH_FAIL:
|
||||
case GL_STENCIL_BACK_PASS_DEPTH_PASS:
|
||||
case GL_STENCIL_BACK_WRITEMASK:
|
||||
case GL_TEXTURE_2D:
|
||||
case GL_TEXTURE_BINDING_2D:
|
||||
case GL_TEXTURE_BINDING_CUBE_MAP:
|
||||
case GL_TEXTURE_BINDING_EXTERNAL_OES:
|
||||
case GL_TEXTURE_COORD_ARRAY:
|
||||
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
|
||||
case GL_TEXTURE_COORD_ARRAY_SIZE:
|
||||
case GL_TEXTURE_COORD_ARRAY_STRIDE:
|
||||
case GL_TEXTURE_COORD_ARRAY_TYPE:
|
||||
case GL_UNPACK_ALIGNMENT:
|
||||
case GL_VERTEX_ARRAY:
|
||||
case GL_VERTEX_ARRAY_BUFFER_BINDING:
|
||||
case GL_VERTEX_ARRAY_SIZE:
|
||||
case GL_VERTEX_ARRAY_STRIDE:
|
||||
case GL_VERTEX_ARRAY_TYPE:
|
||||
case GL_SPOT_CUTOFF:
|
||||
case GL_TEXTURE_MIN_FILTER:
|
||||
case GL_TEXTURE_MAG_FILTER:
|
||||
case GL_TEXTURE_WRAP_S:
|
||||
case GL_TEXTURE_WRAP_T:
|
||||
case GL_GENERATE_MIPMAP:
|
||||
case GL_GENERATE_MIPMAP_HINT:
|
||||
case GL_RENDERBUFFER_WIDTH_OES:
|
||||
case GL_RENDERBUFFER_HEIGHT_OES:
|
||||
case GL_RENDERBUFFER_INTERNAL_FORMAT_OES:
|
||||
case GL_RENDERBUFFER_RED_SIZE_OES:
|
||||
case GL_RENDERBUFFER_GREEN_SIZE_OES:
|
||||
case GL_RENDERBUFFER_BLUE_SIZE_OES:
|
||||
case GL_RENDERBUFFER_ALPHA_SIZE_OES:
|
||||
case GL_RENDERBUFFER_DEPTH_SIZE_OES:
|
||||
case GL_RENDERBUFFER_STENCIL_SIZE_OES:
|
||||
case GL_RENDERBUFFER_BINDING:
|
||||
case GL_FRAMEBUFFER_BINDING:
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES:
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES:
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES:
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES:
|
||||
case GL_FENCE_STATUS_NV:
|
||||
case GL_FENCE_CONDITION_NV:
|
||||
case GL_TEXTURE_WIDTH_QCOM:
|
||||
case GL_TEXTURE_HEIGHT_QCOM:
|
||||
case GL_TEXTURE_DEPTH_QCOM:
|
||||
case GL_TEXTURE_INTERNAL_FORMAT_QCOM:
|
||||
case GL_TEXTURE_FORMAT_QCOM:
|
||||
case GL_TEXTURE_TYPE_QCOM:
|
||||
case GL_TEXTURE_IMAGE_VALID_QCOM:
|
||||
case GL_TEXTURE_NUM_LEVELS_QCOM:
|
||||
case GL_TEXTURE_TARGET_QCOM:
|
||||
case GL_TEXTURE_OBJECT_VALID_QCOM:
|
||||
case GL_BLEND_EQUATION_RGB_OES:
|
||||
case GL_BLEND_EQUATION_ALPHA_OES:
|
||||
case GL_BLEND_DST_RGB_OES:
|
||||
case GL_BLEND_SRC_RGB_OES:
|
||||
case GL_BLEND_DST_ALPHA_OES:
|
||||
case GL_BLEND_SRC_ALPHA_OES:
|
||||
case GL_MAX_LIGHTS:
|
||||
case GL_SHADER_TYPE:
|
||||
case GL_DELETE_STATUS:
|
||||
case GL_COMPILE_STATUS:
|
||||
case GL_INFO_LOG_LENGTH:
|
||||
case GL_SHADER_SOURCE_LENGTH:
|
||||
case GL_CURRENT_PROGRAM:
|
||||
case GL_LINK_STATUS:
|
||||
case GL_VALIDATE_STATUS:
|
||||
case GL_ATTACHED_SHADERS:
|
||||
case GL_ACTIVE_UNIFORMS:
|
||||
case GL_ACTIVE_ATTRIBUTES:
|
||||
case GL_SUBPIXEL_BITS:
|
||||
case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
|
||||
case GL_NUM_SHADER_BINARY_FORMATS:
|
||||
case GL_SHADER_COMPILER:
|
||||
case GL_MAX_VERTEX_ATTRIBS:
|
||||
case GL_MAX_VERTEX_UNIFORM_VECTORS:
|
||||
case GL_MAX_VARYING_VECTORS:
|
||||
case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
|
||||
case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:
|
||||
case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
|
||||
case GL_MAX_RENDERBUFFER_SIZE:
|
||||
case GL_MAX_TEXTURE_IMAGE_UNITS:
|
||||
case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
|
||||
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
|
||||
case GL_LINE_WIDTH:
|
||||
s = 1;
|
||||
break;
|
||||
case GL_ALIASED_LINE_WIDTH_RANGE:
|
||||
case GL_ALIASED_POINT_SIZE_RANGE:
|
||||
case GL_DEPTH_RANGE:
|
||||
case GL_MAX_VIEWPORT_DIMS:
|
||||
case GL_SMOOTH_POINT_SIZE_RANGE:
|
||||
case GL_SMOOTH_LINE_WIDTH_RANGE:
|
||||
s= 2;
|
||||
break;
|
||||
case GL_SPOT_DIRECTION:
|
||||
case GL_POINT_DISTANCE_ATTENUATION:
|
||||
case GL_CURRENT_NORMAL:
|
||||
s = 3;
|
||||
break;
|
||||
case GL_CURRENT_VERTEX_ATTRIB:
|
||||
case GL_CURRENT_TEXTURE_COORDS:
|
||||
case GL_CURRENT_COLOR:
|
||||
case GL_FOG_COLOR:
|
||||
case GL_AMBIENT:
|
||||
case GL_DIFFUSE:
|
||||
case GL_SPECULAR:
|
||||
case GL_EMISSION:
|
||||
case GL_POSITION:
|
||||
case GL_LIGHT_MODEL_AMBIENT:
|
||||
case GL_TEXTURE_ENV_COLOR:
|
||||
case GL_SCISSOR_BOX:
|
||||
case GL_VIEWPORT:
|
||||
case GL_TEXTURE_CROP_RECT_OES:
|
||||
case GL_COLOR_CLEAR_VALUE:
|
||||
case GL_COLOR_WRITEMASK:
|
||||
case GL_AMBIENT_AND_DIFFUSE:
|
||||
case GL_BLEND_COLOR:
|
||||
s = 4;
|
||||
break;
|
||||
case GL_MODELVIEW_MATRIX:
|
||||
case GL_PROJECTION_MATRIX:
|
||||
case GL_TEXTURE_MATRIX:
|
||||
s = 16;
|
||||
break;
|
||||
default:
|
||||
ERR("glUtilsParamSize: unknow param 0x%08x\n", param);
|
||||
s = 1; // assume 1
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void glUtilsPackPointerData(unsigned char *dst, unsigned char *src,
|
||||
int size, GLenum type, unsigned int stride,
|
||||
unsigned int datalen)
|
||||
{
|
||||
unsigned int vsize = size * glSizeof(type);
|
||||
if (stride == 0) stride = vsize;
|
||||
|
||||
if (stride == vsize) {
|
||||
memcpy(dst, src, datalen);
|
||||
} else {
|
||||
for (unsigned int i = 0; i < datalen; i += vsize) {
|
||||
memcpy(dst, src, vsize);
|
||||
dst += vsize;
|
||||
src += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glUtilsWritePackPointerData(void* _stream, unsigned char *src,
|
||||
int size, GLenum type, unsigned int stride,
|
||||
unsigned int datalen)
|
||||
{
|
||||
IOStream* stream = reinterpret_cast<IOStream*>(_stream);
|
||||
|
||||
unsigned int vsize = size * glSizeof(type);
|
||||
if (stride == 0) stride = vsize;
|
||||
|
||||
if (stride == vsize) {
|
||||
stream->writeFully(src, datalen);
|
||||
} else {
|
||||
for (unsigned int i = 0; i < datalen; i += vsize) {
|
||||
stream->writeFully(src, (size_t)vsize);
|
||||
src += stride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int glUtilsPixelBitSize(GLenum format, GLenum type)
|
||||
{
|
||||
int components = 0;
|
||||
int componentsize = 0;
|
||||
int pixelsize = 0;
|
||||
switch(type) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
componentsize = 8;
|
||||
break;
|
||||
case GL_SHORT:
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_UNSIGNED_SHORT_5_6_5:
|
||||
case GL_UNSIGNED_SHORT_4_4_4_4:
|
||||
case GL_UNSIGNED_SHORT_5_5_5_1:
|
||||
case GL_RGB565_OES:
|
||||
case GL_RGB5_A1_OES:
|
||||
case GL_RGBA4_OES:
|
||||
pixelsize = 16;
|
||||
break;
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
case GL_FLOAT:
|
||||
case GL_FIXED:
|
||||
case GL_UNSIGNED_INT_24_8_OES:
|
||||
pixelsize = 32;
|
||||
break;
|
||||
default:
|
||||
ERR("glUtilsPixelBitSize: unknown pixel type - assuming pixel data 0\n");
|
||||
componentsize = 0;
|
||||
}
|
||||
|
||||
if (pixelsize == 0) {
|
||||
switch(format) {
|
||||
#if 0
|
||||
case GL_RED:
|
||||
case GL_GREEN:
|
||||
case GL_BLUE:
|
||||
#endif
|
||||
case GL_ALPHA:
|
||||
case GL_LUMINANCE:
|
||||
case GL_DEPTH_COMPONENT:
|
||||
case GL_DEPTH_STENCIL_OES:
|
||||
components = 1;
|
||||
break;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
components = 2;
|
||||
break;
|
||||
case GL_RGB:
|
||||
#if 0
|
||||
case GL_BGR:
|
||||
#endif
|
||||
components = 3;
|
||||
break;
|
||||
case GL_RGBA:
|
||||
case GL_BGRA_EXT:
|
||||
components = 4;
|
||||
break;
|
||||
default:
|
||||
ERR("glUtilsPixelBitSize: unknown pixel format...\n");
|
||||
components = 0;
|
||||
}
|
||||
pixelsize = components * componentsize;
|
||||
}
|
||||
|
||||
return pixelsize;
|
||||
}
|
||||
|
||||
// pack a list of strings into one.
|
||||
void glUtilsPackStrings(char *ptr, char **strings, GLint *length, GLsizei count)
|
||||
{
|
||||
char *p = ptr;
|
||||
*p = '\0';
|
||||
for (int i = 0; i < count; i++) {
|
||||
int l=0;
|
||||
if (strings[i]!=NULL) {
|
||||
if (length == NULL || length[i] < 0) {
|
||||
l = strlen(strings[i]);
|
||||
strcat(p, strings[i]);
|
||||
} else {
|
||||
l = length[i];
|
||||
strncat(p, strings[i], l);
|
||||
}
|
||||
}
|
||||
p += l;
|
||||
}
|
||||
}
|
||||
|
||||
// claculate the length of a list of strings
|
||||
int glUtilsCalcShaderSourceLen( char **strings, GLint *length, GLsizei count)
|
||||
{
|
||||
int len = 0;
|
||||
for (int i = 0; i < count; i++) {
|
||||
int l;
|
||||
if (length == NULL || length[i] < 0) {
|
||||
l = strings[i]!=NULL ? strlen(strings[i]) : 0;
|
||||
} else {
|
||||
l = length[i];
|
||||
}
|
||||
len += l;
|
||||
}
|
||||
return len;
|
||||
|
||||
}
|
||||
95
tools/emulator/opengl/shared/OpenglCodecCommon/glUtils.h
Normal file
95
tools/emulator/opengl/shared/OpenglCodecCommon/glUtils.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __GL_UTILS_H__
|
||||
#define __GL_UTILS_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef GL_API
|
||||
#undef GL_API
|
||||
#endif
|
||||
#define GL_API
|
||||
|
||||
#ifdef GL_APIENTRY
|
||||
#undef GL_APIENTRY
|
||||
#endif
|
||||
|
||||
#ifdef GL_APIENTRYP
|
||||
#undef GL_APIENTRYP
|
||||
#endif
|
||||
#define GL_APIENTRYP
|
||||
|
||||
#ifndef ANDROID
|
||||
#define GL_APIENTRY
|
||||
#endif
|
||||
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
size_t glSizeof(GLenum type);
|
||||
size_t glUtilsParamSize(GLenum param);
|
||||
void glUtilsPackPointerData(unsigned char *dst, unsigned char *str,
|
||||
int size, GLenum type, unsigned int stride,
|
||||
unsigned int datalen);
|
||||
void glUtilsWritePackPointerData(void* stream, unsigned char *src,
|
||||
int size, GLenum type, unsigned int stride,
|
||||
unsigned int datalen);
|
||||
int glUtilsPixelBitSize(GLenum format, GLenum type);
|
||||
void glUtilsPackStrings(char *ptr, char **strings, GLint *length, GLsizei count);
|
||||
int glUtilsCalcShaderSourceLen(char **strings, GLint *length, GLsizei count);
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
namespace GLUtils {
|
||||
|
||||
template <class T> void minmax(T *indices, int count, int *min, int *max) {
|
||||
*min = -1;
|
||||
*max = -1;
|
||||
T *ptr = indices;
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (*min == -1 || *ptr < *min) *min = *ptr;
|
||||
if (*max == -1 || *ptr > *max) *max = *ptr;
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
template <class T> void shiftIndices(T *indices, int count, int offset) {
|
||||
T *ptr = indices;
|
||||
for (int i = 0; i < count; i++) {
|
||||
*ptr += offset;
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <class T> void shiftIndices(T *src, T *dst, int count, int offset)
|
||||
{
|
||||
for (int i = 0; i < count; i++) {
|
||||
*dst = *src + offset;
|
||||
dst++;
|
||||
src++;
|
||||
}
|
||||
}
|
||||
}; // namespace GLUtils
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __GL_BASE_TYPES__H
|
||||
#define __GL_BASE_TYPES__H
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef gl_APIENTRY
|
||||
#define gl_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#ifndef gl2_APIENTRY
|
||||
#define gl2_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
typedef void GLvoid;
|
||||
typedef unsigned int GLenum;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef char GLchar;
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef short GLshort;
|
||||
typedef int GLint;
|
||||
typedef int GLsizei;
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
typedef unsigned short GLushort;
|
||||
typedef unsigned int GLuint;
|
||||
typedef khronos_float_t GLfloat;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
typedef khronos_int32_t GLclampx;
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
typedef char *GLstr;
|
||||
/* JR XXX Treating this as an in handle - is this correct? */
|
||||
typedef void * GLeglImageOES;
|
||||
|
||||
/* ErrorCode */
|
||||
#ifndef GL_INVALID_ENUM
|
||||
#define GL_NO_ERROR 0
|
||||
#define GL_INVALID_ENUM 0x0500
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_OPERATION 0x0502
|
||||
#define GL_STACK_OVERFLOW 0x0503
|
||||
#define GL_STACK_UNDERFLOW 0x0504
|
||||
#define GL_OUT_OF_MEMORY 0x0505
|
||||
#endif
|
||||
|
||||
#endif
|
||||
20
tools/emulator/opengl/shared/OpenglOsUtils/Android.mk
Normal file
20
tools/emulator/opengl/shared/OpenglOsUtils/Android.mk
Normal file
@@ -0,0 +1,20 @@
|
||||
# This build script corresponds to a small library containing
|
||||
# OS-specific support functions for:
|
||||
# - thread-local storage
|
||||
# - dynamic library loading
|
||||
# - child process creation and wait (probably not needed in guest)
|
||||
#
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
### Guest library ##############################################
|
||||
$(call emugl-begin-static-library,libOpenglOsUtils)
|
||||
|
||||
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
|
||||
$(call emugl-export,LDLIBS,-ldl)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
osProcessUnix.cpp \
|
||||
osThreadUnix.cpp \
|
||||
osDynLibrary.cpp
|
||||
|
||||
$(call emugl-end-module)
|
||||
79
tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.cpp
Normal file
79
tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "osDynLibrary.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
dynLibrary *dynLibrary::open(const char *p_libName)
|
||||
{
|
||||
dynLibrary *lib = new dynLibrary();
|
||||
if (!lib) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
lib->m_lib = LoadLibrary(p_libName);
|
||||
#else // !WIN32
|
||||
lib->m_lib = dlopen(p_libName, RTLD_NOW);
|
||||
#endif
|
||||
|
||||
if (lib->m_lib == NULL) {
|
||||
printf("Failed to load %s\n", p_libName);
|
||||
#ifndef _WIN32
|
||||
printf("error %s\n", dlerror()); //only on linux
|
||||
#endif
|
||||
delete lib;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return lib;
|
||||
}
|
||||
|
||||
dynLibrary::dynLibrary() :
|
||||
m_lib(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
dynLibrary::~dynLibrary()
|
||||
{
|
||||
if (NULL != m_lib) {
|
||||
#ifdef _WIN32
|
||||
FreeLibrary(m_lib);
|
||||
#else // !WIN32
|
||||
dlclose(m_lib);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
dynFuncPtr dynLibrary::findSymbol(const char *p_symName)
|
||||
{
|
||||
if (NULL == m_lib) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
return (dynFuncPtr) GetProcAddress(m_lib, p_symName);
|
||||
#else // !WIN32
|
||||
return (dynFuncPtr) dlsym(m_lib, p_symName);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // of namespace osUtils
|
||||
71
tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.h
Normal file
71
tools/emulator/opengl/shared/OpenglOsUtils/osDynLibrary.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _OSUTILS_DYN_LIBRARY_H
|
||||
#define _OSUTILS_DYN_LIBRARY_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
typedef void (*dynFuncPtr)(void);
|
||||
|
||||
class dynLibrary
|
||||
{
|
||||
public:
|
||||
static dynLibrary *open(const char *p_libName);
|
||||
~dynLibrary();
|
||||
|
||||
dynFuncPtr findSymbol(const char *p_symName);
|
||||
|
||||
private:
|
||||
dynLibrary();
|
||||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
HMODULE m_lib;
|
||||
#else
|
||||
void *m_lib;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // of namespace osUtils
|
||||
|
||||
|
||||
|
||||
// Macro to compose emugl shared library name under various OS and bitness
|
||||
// eg.
|
||||
// on x86_64, EMUGL_LIBNAME("foo") --> "lib64foo.so"
|
||||
|
||||
#ifdef _WIN32
|
||||
# define DLL_EXTENSION "" // _WIN32 LoadLibrary only accept name w/o .dll extension
|
||||
#elif defined(__APPLE__)
|
||||
# define DLL_EXTENSION ".dylib"
|
||||
#else
|
||||
# define DLL_EXTENSION ".so"
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__)
|
||||
# define EMUGL_LIBNAME(name) "lib64" name DLL_EXTENSION
|
||||
#elif defined(__i386__)
|
||||
# define EMUGL_LIBNAME(name) "lib" name DLL_EXTENSION
|
||||
#else
|
||||
/* This header is included by target w/o using EMUGL_LIBNAME(). Don't #error, leave it undefined */
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
62
tools/emulator/opengl/shared/OpenglOsUtils/osProcess.h
Normal file
62
tools/emulator/opengl/shared/OpenglOsUtils/osProcess.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _OSUTILS_PROCESS_H
|
||||
#define _OSUTILS_PROCESS_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
class childProcess
|
||||
{
|
||||
public:
|
||||
static childProcess *create(const char *p_cmdLine, const char *p_startdir);
|
||||
~childProcess();
|
||||
|
||||
int getPID()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return m_proc.dwProcessId;
|
||||
#else
|
||||
return(m_pid);
|
||||
#endif
|
||||
}
|
||||
|
||||
int tryWait(bool& isAlive);
|
||||
bool wait(int *exitStatus);
|
||||
|
||||
private:
|
||||
childProcess() {};
|
||||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
PROCESS_INFORMATION m_proc;
|
||||
#else
|
||||
int m_pid;
|
||||
#endif
|
||||
};
|
||||
|
||||
int ProcessGetPID();
|
||||
int ProcessGetTID();
|
||||
bool ProcessGetName(char *p_outName, int p_outNameLen);
|
||||
int KillProcess(int pid, bool wait);
|
||||
bool isProcessRunning(int pid);
|
||||
|
||||
} // of namespace osUtils
|
||||
|
||||
#endif
|
||||
210
tools/emulator/opengl/shared/OpenglOsUtils/osProcessUnix.cpp
Normal file
210
tools/emulator/opengl/shared/OpenglOsUtils/osProcessUnix.cpp
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "osProcess.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/types.h>
|
||||
#include <poll.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
#include <pwd.h>
|
||||
#include <paths.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
//
|
||||
// buildArgList converts a command line into null terminated argument list.
|
||||
// to be used with execv or execvp.
|
||||
// each argument is seperated by space or tab, to specify multiple words
|
||||
// at the same argument place it inside single-quoted or double-quoted string.
|
||||
//
|
||||
static char **buildArgList(const char *command)
|
||||
{
|
||||
char **argv = NULL;
|
||||
int argvSize = 0;
|
||||
int nArgs = 0;
|
||||
char *tmpcmd = strdup(command);
|
||||
char *t = tmpcmd;
|
||||
char *strStart = NULL;
|
||||
int i = 0;
|
||||
|
||||
#define ADD_ARG \
|
||||
{ \
|
||||
nArgs++; \
|
||||
if (!argv) { \
|
||||
argvSize = 12; \
|
||||
argv = (char **)malloc(argvSize * sizeof(char *)); \
|
||||
} \
|
||||
else if (nArgs > argvSize) { \
|
||||
argvSize += 12; \
|
||||
argv = (char **)realloc(argv, argvSize * sizeof(char *)); \
|
||||
} \
|
||||
argv[nArgs-1] = t; \
|
||||
t = NULL; \
|
||||
}
|
||||
|
||||
while( tmpcmd[i] != '\0' ) {
|
||||
if (!strStart) {
|
||||
if (tmpcmd[i] == '"' || tmpcmd[i] == '\'') {
|
||||
strStart = &tmpcmd[i];
|
||||
}
|
||||
else if (tmpcmd[i] == ' ' || tmpcmd[i] == '\t') {
|
||||
tmpcmd[i] = '\0';
|
||||
if (t) ADD_ARG;
|
||||
}
|
||||
else if (!t) {
|
||||
t = &tmpcmd[i];
|
||||
}
|
||||
}
|
||||
else if (tmpcmd[i] == *strStart) {
|
||||
t = strStart;
|
||||
strStart = NULL;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
if (t) {
|
||||
ADD_ARG;
|
||||
}
|
||||
if (nArgs > 0) {
|
||||
ADD_ARG; // for NULL terminating list
|
||||
}
|
||||
|
||||
return argv;
|
||||
}
|
||||
|
||||
static pid_t start_process(const char *command,const char *startDir)
|
||||
{
|
||||
pid_t pid;
|
||||
|
||||
pid = fork();
|
||||
|
||||
if (pid < 0) {
|
||||
return pid;
|
||||
}
|
||||
else if (pid == 0) {
|
||||
//
|
||||
// Close all opened file descriptors
|
||||
//
|
||||
for (int i=3; i<256; i++) {
|
||||
close(i);
|
||||
}
|
||||
|
||||
if (startDir) {
|
||||
chdir(startDir);
|
||||
}
|
||||
|
||||
char **argv = buildArgList(command);
|
||||
if (!argv) {
|
||||
return -1;
|
||||
}
|
||||
execvp(argv[0], argv);
|
||||
|
||||
perror("execl");
|
||||
exit(-101);
|
||||
}
|
||||
|
||||
return pid;
|
||||
}
|
||||
|
||||
childProcess *
|
||||
childProcess::create(const char *p_cmdLine, const char *p_startdir)
|
||||
{
|
||||
childProcess *child = new childProcess();
|
||||
if (!child) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
child->m_pid = start_process(p_cmdLine, p_startdir);
|
||||
if (child->m_pid < 0) {
|
||||
delete child;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
childProcess::~childProcess()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
childProcess::wait(int *exitStatus)
|
||||
{
|
||||
int ret=0;
|
||||
if (m_pid>0) {
|
||||
pid_t pid = waitpid(m_pid,&ret,0);
|
||||
if (pid != -1) {
|
||||
m_pid=-1;
|
||||
if (exitStatus) {
|
||||
*exitStatus = ret;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
childProcess::tryWait(bool &isAlive)
|
||||
{
|
||||
int ret=0;
|
||||
isAlive = false;
|
||||
if (m_pid>0) {
|
||||
pid_t pid = waitpid(m_pid,&ret,WNOHANG);
|
||||
if (pid == 0) {
|
||||
isAlive = true;
|
||||
}
|
||||
}
|
||||
|
||||
return ((char)WEXITSTATUS(ret));
|
||||
}
|
||||
|
||||
int ProcessGetPID()
|
||||
{
|
||||
return getpid();
|
||||
}
|
||||
|
||||
int KillProcess(int pid, bool wait)
|
||||
{
|
||||
if (pid<1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0!=kill(pid,SIGTERM)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (wait) {
|
||||
if (waitpid(pid,NULL,0)<0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isProcessRunning(int pid)
|
||||
{
|
||||
return (kill(pid,0) == 0);
|
||||
}
|
||||
|
||||
} // of namespace osUtils
|
||||
171
tools/emulator/opengl/shared/OpenglOsUtils/osProcessWin.cpp
Normal file
171
tools/emulator/opengl/shared/OpenglOsUtils/osProcessWin.cpp
Normal file
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "osProcess.h"
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
#include <psapi.h>
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
childProcess *
|
||||
childProcess::create(const char *p_cmdLine, const char *p_startdir)
|
||||
{
|
||||
childProcess *child = new childProcess();
|
||||
if (!child) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
STARTUPINFOA si;
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
|
||||
ZeroMemory(&child->m_proc, sizeof(child->m_proc));
|
||||
BOOL ret = CreateProcessA(
|
||||
NULL ,
|
||||
(LPSTR)p_cmdLine,
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
CREATE_DEFAULT_ERROR_MODE,
|
||||
NULL,
|
||||
(p_startdir != NULL ? p_startdir : ".\\"),
|
||||
&si,
|
||||
&child->m_proc);
|
||||
if (ret == 0) {
|
||||
delete child;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// close the thread handle we do not need it,
|
||||
// keep the process handle for wait/trywait operations, will
|
||||
// be closed on destruction
|
||||
CloseHandle(child->m_proc.hThread);
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
childProcess::~childProcess()
|
||||
{
|
||||
if (m_proc.hProcess) {
|
||||
CloseHandle(m_proc.hProcess);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
childProcess::wait(int *exitStatus)
|
||||
{
|
||||
DWORD _exitStatus;
|
||||
|
||||
if (WaitForSingleObject(m_proc.hProcess, INFINITE) == WAIT_FAILED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GetExitCodeProcess(m_proc.hProcess, &_exitStatus))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (exitStatus) {
|
||||
*exitStatus = _exitStatus;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
childProcess::tryWait(bool& isAlive)
|
||||
{
|
||||
DWORD status = WaitForSingleObject(m_proc.hProcess, 0);
|
||||
|
||||
if(status == WAIT_OBJECT_0)
|
||||
{
|
||||
// process has exited
|
||||
isAlive = false;
|
||||
GetExitCodeProcess(m_proc.hProcess, &status);
|
||||
}
|
||||
else if (status == WAIT_TIMEOUT)
|
||||
{
|
||||
isAlive = true;
|
||||
status = 0;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
int ProcessGetPID()
|
||||
{
|
||||
return GetCurrentProcessId();
|
||||
}
|
||||
|
||||
int ProcessGetTID()
|
||||
{
|
||||
return GetCurrentThreadId();
|
||||
}
|
||||
|
||||
bool ProcessGetName(char *p_outName, int p_outNameLen)
|
||||
{
|
||||
return 0 != GetModuleFileNameEx( GetCurrentProcess(), NULL, p_outName, p_outNameLen);
|
||||
}
|
||||
|
||||
int KillProcess(int pid, bool wait)
|
||||
{
|
||||
DWORD exitStatus = 1;
|
||||
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
|
||||
|
||||
if (NULL == hProc) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Terminate the process
|
||||
//
|
||||
TerminateProcess(hProc, 0x55);
|
||||
|
||||
if (wait) {
|
||||
//
|
||||
// Wait for it to be terminated
|
||||
//
|
||||
if(WaitForSingleObject(hProc, INFINITE) == WAIT_FAILED) {
|
||||
CloseHandle(hProc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!GetExitCodeProcess(hProc, &exitStatus)) {
|
||||
CloseHandle(hProc);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(hProc);
|
||||
|
||||
return exitStatus;
|
||||
}
|
||||
|
||||
bool isProcessRunning(int pid)
|
||||
{
|
||||
bool isRunning = false;
|
||||
|
||||
HANDLE process = OpenProcess(SYNCHRONIZE, FALSE, pid);
|
||||
if (NULL != process) {
|
||||
DWORD ret = WaitForSingleObject(process, 0);
|
||||
CloseHandle(process);
|
||||
isRunning = (ret == WAIT_TIMEOUT);
|
||||
}
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
} // of namespace osUtils
|
||||
60
tools/emulator/opengl/shared/OpenglOsUtils/osThread.h
Normal file
60
tools/emulator/opengl/shared/OpenglOsUtils/osThread.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _OSUTILS_THREAD_H
|
||||
#define _OSUTILS_THREAD_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else // !WIN32
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
class Thread
|
||||
{
|
||||
public:
|
||||
Thread();
|
||||
virtual ~Thread();
|
||||
|
||||
virtual int Main() = 0;
|
||||
|
||||
bool start();
|
||||
bool wait(int *exitStatus);
|
||||
bool trywait(int *exitStatus);
|
||||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
static DWORD WINAPI thread_main(void *p_arg);
|
||||
#else // !WIN32
|
||||
static void* thread_main(void *p_arg);
|
||||
#endif
|
||||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
HANDLE m_thread;
|
||||
DWORD m_threadId;
|
||||
#else // !WIN32
|
||||
pthread_t m_thread;
|
||||
int m_exitStatus;
|
||||
pthread_mutex_t m_lock;
|
||||
#endif
|
||||
bool m_isRunning;
|
||||
};
|
||||
|
||||
} // of namespace osUtils
|
||||
|
||||
#endif
|
||||
94
tools/emulator/opengl/shared/OpenglOsUtils/osThreadUnix.cpp
Normal file
94
tools/emulator/opengl/shared/OpenglOsUtils/osThreadUnix.cpp
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "osThread.h"
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
Thread::Thread() :
|
||||
m_thread((pthread_t)NULL),
|
||||
m_exitStatus(0),
|
||||
m_isRunning(false)
|
||||
{
|
||||
pthread_mutex_init(&m_lock, NULL);
|
||||
}
|
||||
|
||||
Thread::~Thread()
|
||||
{
|
||||
pthread_mutex_destroy(&m_lock);
|
||||
}
|
||||
|
||||
bool
|
||||
Thread::start()
|
||||
{
|
||||
pthread_mutex_lock(&m_lock);
|
||||
m_isRunning = true;
|
||||
int ret = pthread_create(&m_thread, NULL, Thread::thread_main, this);
|
||||
if(ret) {
|
||||
m_isRunning = false;
|
||||
}
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return m_isRunning;
|
||||
}
|
||||
|
||||
bool
|
||||
Thread::wait(int *exitStatus)
|
||||
{
|
||||
if (!m_isRunning) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void *retval;
|
||||
if (pthread_join(m_thread,&retval)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long long int ret=(long long int)retval;
|
||||
if (exitStatus) {
|
||||
*exitStatus = (int)ret;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
Thread::trywait(int *exitStatus)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
pthread_mutex_lock(&m_lock);
|
||||
if (!m_isRunning) {
|
||||
*exitStatus = m_exitStatus;
|
||||
ret = true;
|
||||
}
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *
|
||||
Thread::thread_main(void *p_arg)
|
||||
{
|
||||
Thread *self = (Thread *)p_arg;
|
||||
int ret = self->Main();
|
||||
|
||||
pthread_mutex_lock(&self->m_lock);
|
||||
self->m_isRunning = false;
|
||||
self->m_exitStatus = ret;
|
||||
pthread_mutex_unlock(&self->m_lock);
|
||||
|
||||
return (void*)ret;
|
||||
}
|
||||
|
||||
} // of namespace osUtils
|
||||
|
||||
101
tools/emulator/opengl/shared/OpenglOsUtils/osThreadWin.cpp
Normal file
101
tools/emulator/opengl/shared/OpenglOsUtils/osThreadWin.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "osThread.h"
|
||||
|
||||
namespace osUtils {
|
||||
|
||||
Thread::Thread() :
|
||||
m_thread(NULL),
|
||||
m_threadId(0),
|
||||
m_isRunning(false)
|
||||
{
|
||||
}
|
||||
|
||||
Thread::~Thread()
|
||||
{
|
||||
if(m_thread) {
|
||||
CloseHandle(m_thread);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Thread::start()
|
||||
{
|
||||
m_isRunning = true;
|
||||
m_thread = CreateThread(NULL, 0, &Thread::thread_main, this, 0, &m_threadId);
|
||||
if(!m_thread) {
|
||||
m_isRunning = false;
|
||||
}
|
||||
return m_isRunning;
|
||||
}
|
||||
|
||||
bool
|
||||
Thread::wait(int *exitStatus)
|
||||
{
|
||||
if (!m_isRunning) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(WaitForSingleObject(m_thread, INFINITE) == WAIT_FAILED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DWORD retval;
|
||||
if (!GetExitCodeThread(m_thread,&retval)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
m_isRunning = 0;
|
||||
|
||||
if (exitStatus) {
|
||||
*exitStatus = retval;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
Thread::trywait(int *exitStatus)
|
||||
{
|
||||
if (!m_isRunning) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(WaitForSingleObject(m_thread, 0) == WAIT_OBJECT_0) {
|
||||
|
||||
DWORD retval;
|
||||
if (!GetExitCodeThread(m_thread,&retval)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (exitStatus) {
|
||||
*exitStatus = retval;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
DWORD WINAPI
|
||||
Thread::thread_main(void *p_arg)
|
||||
{
|
||||
Thread *self = (Thread *)p_arg;
|
||||
int ret = self->Main();
|
||||
self->m_isRunning = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // of namespace osUtils
|
||||
12
tools/emulator/opengl/system/GLESv1/Android.mk
Normal file
12
tools/emulator/opengl/system/GLESv1/Android.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
### GLESv1 implementation ###########################################
|
||||
$(call emugl-begin-shared-library,libGLESv1_CM_emulation)
|
||||
$(call emugl-import,libOpenglSystemCommon libGLESv1_enc lib_renderControl_enc)
|
||||
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"GLES_emulation\" -DGL_GLEXT_PROTOTYPES
|
||||
|
||||
LOCAL_SRC_FILES := gl.cpp
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
|
||||
|
||||
$(call emugl-end-module)
|
||||
146
tools/emulator/opengl/system/GLESv1/gl.cpp
Normal file
146
tools/emulator/opengl/system/GLESv1/gl.cpp
Normal file
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Copyright 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "EGLClientIface.h"
|
||||
#include "HostConnection.h"
|
||||
#include "GLEncoder.h"
|
||||
#include "GLES/gl.h"
|
||||
#include "GLES/glext.h"
|
||||
#include "ErrorLog.h"
|
||||
#include "gralloc_cb.h"
|
||||
#include "ThreadInfo.h"
|
||||
|
||||
|
||||
//XXX: fix this macro to get the context from fast tls path
|
||||
#define GET_CONTEXT GLEncoder * ctx = getEGLThreadInfo()->hostConn->glEncoder();
|
||||
|
||||
#include "gl_entry.cpp"
|
||||
|
||||
//The functions table
|
||||
#include "gl_ftable.h"
|
||||
|
||||
static EGLClient_eglInterface * s_egl = NULL;
|
||||
static EGLClient_glesInterface * s_gl = NULL;
|
||||
|
||||
#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
|
||||
HostConnection *hostCon = HostConnection::get(); \
|
||||
if (!hostCon) { \
|
||||
ALOGE("egl: Failed to get host connection\n"); \
|
||||
return ret; \
|
||||
} \
|
||||
renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
|
||||
if (!rcEnc) { \
|
||||
ALOGE("egl: Failed to get renderControl encoder context\n"); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
//GL extensions
|
||||
void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES image)
|
||||
{
|
||||
DBG("glEGLImageTargetTexture2DOES v1 target=%#x image=%p", target, image);
|
||||
//TODO: check error - we don't have a way to set gl error
|
||||
android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
|
||||
|
||||
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GET_CONTEXT;
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION();
|
||||
|
||||
ctx->override2DTextureTarget(target);
|
||||
rcEnc->rcBindTexture(rcEnc,
|
||||
((cb_handle_t *)(native_buffer->handle))->hostHandle);
|
||||
ctx->restore2DTextureTarget();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES image)
|
||||
{
|
||||
DBG("glEGLImageTargetRenderbufferStorageOES v1 target=%#x image=%p",
|
||||
target, image);
|
||||
//TODO: check error - we don't have a way to set gl error
|
||||
android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
|
||||
|
||||
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
|
||||
return;
|
||||
}
|
||||
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION();
|
||||
rcEnc->rcBindRenderbuffer(rcEnc,
|
||||
((cb_handle_t *)(native_buffer->handle))->hostHandle);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void * getProcAddress(const char * procname)
|
||||
{
|
||||
// search in GL function table
|
||||
for (int i=0; i<gl_num_funcs; i++) {
|
||||
if (!strcmp(gl_funcs_by_name[i].name, procname)) {
|
||||
return gl_funcs_by_name[i].proc;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void finish()
|
||||
{
|
||||
glFinish();
|
||||
}
|
||||
|
||||
const GLubyte *my_glGetString (void *self, GLenum name)
|
||||
{
|
||||
if (s_egl) {
|
||||
return (const GLubyte*)s_egl->getGLString(name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void init()
|
||||
{
|
||||
GET_CONTEXT;
|
||||
ctx->set_glEGLImageTargetTexture2DOES(glEGLImageTargetTexture2DOES);
|
||||
ctx->set_glEGLImageTargetRenderbufferStorageOES(glEGLImageTargetRenderbufferStorageOES);
|
||||
ctx->set_glGetString(my_glGetString);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
|
||||
{
|
||||
s_egl = eglIface;
|
||||
|
||||
if (!s_gl) {
|
||||
s_gl = new EGLClient_glesInterface();
|
||||
s_gl->getProcAddress = getProcAddress;
|
||||
s_gl->finish = finish;
|
||||
s_gl->init = init;
|
||||
}
|
||||
|
||||
return s_gl;
|
||||
}
|
||||
} //extern
|
||||
|
||||
|
||||
19
tools/emulator/opengl/system/GLESv1_enc/Android.mk
Normal file
19
tools/emulator/opengl/system/GLESv1_enc/Android.mk
Normal file
@@ -0,0 +1,19 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
### GLESv1_enc Encoder ###########################################
|
||||
$(call emugl-begin-shared-library,libGLESv1_enc)
|
||||
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv1_enc\"
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
GLEncoder.cpp \
|
||||
GLEncoderUtils.cpp \
|
||||
gl_client_context.cpp \
|
||||
gl_enc.cpp \
|
||||
gl_entry.cpp
|
||||
|
||||
$(call emugl-import,libOpenglCodecCommon)
|
||||
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
|
||||
$(call emugl-export,C_INCLUDES,$(intermediates))
|
||||
|
||||
$(call emugl-end-module)
|
||||
989
tools/emulator/opengl/system/GLESv1_enc/GLEncoder.cpp
Normal file
989
tools/emulator/opengl/system/GLESv1_enc/GLEncoder.cpp
Normal file
@@ -0,0 +1,989 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "GLEncoder.h"
|
||||
#include "glUtils.h"
|
||||
#include "FixedBuffer.h"
|
||||
#include <cutils/log.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
static GLubyte *gVendorString= (GLubyte *) "Android";
|
||||
static GLubyte *gRendererString= (GLubyte *) "Android HW-GLES 1.0";
|
||||
static GLubyte *gVersionString= (GLubyte *) "OpenGL ES-CM 1.0";
|
||||
static GLubyte *gExtensionsString= (GLubyte *) ""; // no extensions at this point;
|
||||
|
||||
#define SET_ERROR_IF(condition,err) if((condition)) { \
|
||||
ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
|
||||
ctx->setError(err); \
|
||||
return; \
|
||||
}
|
||||
|
||||
|
||||
#define RET_AND_SET_ERROR_IF(condition,err,ret) if((condition)) { \
|
||||
ALOGE("%s:%s:%d GL error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
|
||||
ctx->setError(err); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
GLenum GLEncoder::s_glGetError(void * self)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
GLenum err = ctx->getError();
|
||||
if(err != GL_NO_ERROR) {
|
||||
ctx->setError(GL_NO_ERROR);
|
||||
return err;
|
||||
}
|
||||
|
||||
return ctx->m_glGetError_enc(self);
|
||||
|
||||
}
|
||||
|
||||
GLint * GLEncoder::getCompressedTextureFormats()
|
||||
{
|
||||
if (m_compressedTextureFormats == NULL) {
|
||||
this->glGetIntegerv(this, GL_NUM_COMPRESSED_TEXTURE_FORMATS,
|
||||
&m_num_compressedTextureFormats);
|
||||
if (m_num_compressedTextureFormats > 0) {
|
||||
// get number of texture formats;
|
||||
m_compressedTextureFormats = new GLint[m_num_compressedTextureFormats];
|
||||
this->glGetCompressedTextureFormats(this, m_num_compressedTextureFormats, m_compressedTextureFormats);
|
||||
}
|
||||
}
|
||||
return m_compressedTextureFormats;
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetIntegerv(void *self, GLenum param, GLint *ptr)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
GLClientState* state = ctx->m_state;
|
||||
|
||||
switch (param) {
|
||||
case GL_COMPRESSED_TEXTURE_FORMATS: {
|
||||
GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
|
||||
if (ctx->m_num_compressedTextureFormats > 0 &&
|
||||
compressedTextureFormats != NULL) {
|
||||
memcpy(ptr, compressedTextureFormats,
|
||||
ctx->m_num_compressedTextureFormats * sizeof(GLint));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GL_MAX_TEXTURE_UNITS:
|
||||
ctx->m_glGetIntegerv_enc(self, param, ptr);
|
||||
*ptr = MIN(*ptr, GLClientState::MAX_TEXTURE_UNITS);
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_2D:
|
||||
*ptr = state->getBoundTexture(GL_TEXTURE_2D);
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_EXTERNAL_OES:
|
||||
*ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!state->getClientStateParameter<GLint>(param,ptr)) {
|
||||
ctx->m_glGetIntegerv_enc(self, param, ptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetFloatv(void *self, GLenum param, GLfloat *ptr)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
GLClientState* state = ctx->m_state;
|
||||
|
||||
switch (param) {
|
||||
case GL_COMPRESSED_TEXTURE_FORMATS: {
|
||||
GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
|
||||
if (ctx->m_num_compressedTextureFormats > 0 &&
|
||||
compressedTextureFormats != NULL) {
|
||||
for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
|
||||
ptr[i] = (GLfloat) compressedTextureFormats[i];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GL_MAX_TEXTURE_UNITS:
|
||||
ctx->m_glGetFloatv_enc(self, param, ptr);
|
||||
*ptr = MIN(*ptr, (GLfloat)GLClientState::MAX_TEXTURE_UNITS);
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_2D:
|
||||
*ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_2D);
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_EXTERNAL_OES:
|
||||
*ptr = (GLfloat)state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!state->getClientStateParameter<GLfloat>(param,ptr)) {
|
||||
ctx->m_glGetFloatv_enc(self, param, ptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetFixedv(void *self, GLenum param, GLfixed *ptr)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
GLClientState* state = ctx->m_state;
|
||||
|
||||
switch (param) {
|
||||
case GL_COMPRESSED_TEXTURE_FORMATS: {
|
||||
GLint * compressedTextureFormats = ctx->getCompressedTextureFormats();
|
||||
if (ctx->m_num_compressedTextureFormats > 0 &&
|
||||
compressedTextureFormats != NULL) {
|
||||
for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
|
||||
ptr[i] = compressedTextureFormats[i] << 16;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GL_MAX_TEXTURE_UNITS:
|
||||
ctx->m_glGetFixedv_enc(self, param, ptr);
|
||||
*ptr = MIN(*ptr, GLClientState::MAX_TEXTURE_UNITS << 16);
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_2D:
|
||||
*ptr = state->getBoundTexture(GL_TEXTURE_2D) << 16;
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_EXTERNAL_OES:
|
||||
*ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES) << 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!state->getClientStateParameter<GLfixed>(param,ptr)) {
|
||||
ctx->m_glGetFixedv_enc(self, param, ptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetBooleanv(void *self, GLenum param, GLboolean *ptr)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
GLClientState* state = ctx->m_state;
|
||||
|
||||
switch (param) {
|
||||
case GL_COMPRESSED_TEXTURE_FORMATS: {
|
||||
GLint* compressedTextureFormats = ctx->getCompressedTextureFormats();
|
||||
if (ctx->m_num_compressedTextureFormats > 0 &&
|
||||
compressedTextureFormats != NULL) {
|
||||
for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
|
||||
ptr[i] = compressedTextureFormats[i] != 0 ? GL_TRUE : GL_FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GL_TEXTURE_BINDING_2D:
|
||||
*ptr = state->getBoundTexture(GL_TEXTURE_2D) != 0 ? GL_TRUE : GL_FALSE;
|
||||
break;
|
||||
|
||||
case GL_TEXTURE_BINDING_EXTERNAL_OES:
|
||||
*ptr = state->getBoundTexture(GL_TEXTURE_EXTERNAL_OES) != 0
|
||||
? GL_TRUE : GL_FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!state->getClientStateParameter<GLboolean>(param,ptr)) {
|
||||
ctx->m_glGetBooleanv_enc(self, param, ptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetPointerv(void * self, GLenum param, GLvoid **params)
|
||||
{
|
||||
GLEncoder * ctx = (GLEncoder *) self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->getClientStatePointer(param,params);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glFlush(void *self)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
ctx->m_glFlush_enc(self);
|
||||
ctx->m_stream->flush();
|
||||
}
|
||||
|
||||
const GLubyte *GLEncoder::s_glGetString(void *self, GLenum name)
|
||||
{
|
||||
GLubyte *retval = (GLubyte *) "";
|
||||
switch(name) {
|
||||
case GL_VENDOR:
|
||||
retval = gVendorString;
|
||||
break;
|
||||
case GL_RENDERER:
|
||||
retval = gRendererString;
|
||||
break;
|
||||
case GL_VERSION:
|
||||
retval = gVersionString;
|
||||
break;
|
||||
case GL_EXTENSIONS:
|
||||
retval = gExtensionsString;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void GLEncoder::s_glPixelStorei(void *self, GLenum param, GLint value)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
ctx->m_glPixelStorei_enc(ctx, param, value);
|
||||
ALOG_ASSERT(ctx->m_state, "GLEncoder::s_glPixelStorei");
|
||||
ctx->m_state->setPixelStore(param, value);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setState(GLClientState::VERTEX_LOCATION, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setState(GLClientState::NORMAL_LOCATION, 3, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setState(GLClientState::COLOR_LOCATION, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glPointsizePointer(void *self, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setState(GLClientState::POINTSIZE_LOCATION, 1, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glClientActiveTexture(void *self, GLenum texture)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->setActiveTexture(texture - GL_TEXTURE0);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
int loc = ctx->m_state->getLocation(GL_TEXTURE_COORD_ARRAY);
|
||||
ctx->m_state->setState(loc, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
int loc = ctx->m_state->getLocation(GL_MATRIX_INDEX_ARRAY_OES);
|
||||
ctx->m_state->setState(loc, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glWeightPointerOES(void * self, int size, GLenum type, GLsizei stride, const void * data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
int loc = ctx->m_state->getLocation(GL_WEIGHT_ARRAY_OES);
|
||||
ctx->m_state->setState(loc, size, type, false, stride, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glEnableClientState(void *self, GLenum state)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *) self;
|
||||
assert(ctx->m_state != NULL);
|
||||
int loc = ctx->m_state->getLocation(state);
|
||||
ctx->m_state->enable(loc, 1);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glDisableClientState(void *self, GLenum state)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *) self;
|
||||
assert(ctx->m_state != NULL);
|
||||
int loc = ctx->m_state->getLocation(state);
|
||||
ctx->m_state->enable(loc, 0);
|
||||
}
|
||||
|
||||
GLboolean GLEncoder::s_glIsEnabled(void *self, GLenum cap)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *) self;
|
||||
assert(ctx->m_state != NULL);
|
||||
int loc = ctx->m_state->getLocation(cap);
|
||||
const GLClientState::VertexAttribState *state = ctx->m_state->getState(loc);
|
||||
|
||||
if (state!=NULL)
|
||||
return state->enabled;
|
||||
|
||||
return ctx->m_glIsEnabled_enc(self,cap);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glBindBuffer(void *self, GLenum target, GLuint id)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *) self;
|
||||
assert(ctx->m_state != NULL);
|
||||
ctx->m_state->bindBuffer(target, id);
|
||||
// TODO set error state if needed;
|
||||
ctx->m_glBindBuffer_enc(self, target, id);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glBufferData(void * self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *) self;
|
||||
GLuint bufferId = ctx->m_state->getBuffer(target);
|
||||
SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
|
||||
SET_ERROR_IF(size<0, GL_INVALID_VALUE);
|
||||
|
||||
ctx->m_shared->updateBufferData(bufferId, size, (void*)data);
|
||||
ctx->m_glBufferData_enc(self, target, size, data, usage);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glBufferSubData(void * self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *) self;
|
||||
GLuint bufferId = ctx->m_state->getBuffer(target);
|
||||
SET_ERROR_IF(bufferId==0, GL_INVALID_OPERATION);
|
||||
|
||||
GLenum res = ctx->m_shared->subUpdateBufferData(bufferId, offset, size, (void*)data);
|
||||
SET_ERROR_IF(res, res);
|
||||
|
||||
ctx->m_glBufferSubData_enc(self, target, offset, size, data);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glDeleteBuffers(void * self, GLsizei n, const GLuint * buffers)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *) self;
|
||||
SET_ERROR_IF(n<0, GL_INVALID_VALUE);
|
||||
for (int i=0; i<n; i++) {
|
||||
ctx->m_shared->deleteBufferData(buffers[i]);
|
||||
ctx->m_glDeleteBuffers_enc(self,1,&buffers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::sendVertexData(unsigned int first, unsigned int count)
|
||||
{
|
||||
assert(m_state != NULL);
|
||||
for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
|
||||
bool enableDirty;
|
||||
const GLClientState::VertexAttribState *state = m_state->getStateAndEnableDirty(i, &enableDirty);
|
||||
|
||||
// do not process if state not valid
|
||||
if (!state) continue;
|
||||
|
||||
// do not send disable state if state was already disabled
|
||||
if (!enableDirty && !state->enabled) continue;
|
||||
|
||||
if ( i >= GLClientState::TEXCOORD0_LOCATION &&
|
||||
i <= GLClientState::TEXCOORD7_LOCATION ) {
|
||||
m_glClientActiveTexture_enc(this, GL_TEXTURE0 + i - GLClientState::TEXCOORD0_LOCATION);
|
||||
}
|
||||
|
||||
if (state->enabled) {
|
||||
|
||||
if (enableDirty)
|
||||
m_glEnableClientState_enc(this, state->glConst);
|
||||
|
||||
unsigned int datalen = state->elementSize * count;
|
||||
int stride = state->stride;
|
||||
if (stride == 0) stride = state->elementSize;
|
||||
int firstIndex = stride * first;
|
||||
|
||||
if (state->bufferObject == 0) {
|
||||
|
||||
switch(i) {
|
||||
case GLClientState::VERTEX_LOCATION:
|
||||
this->glVertexPointerData(this, state->size, state->type, state->stride,
|
||||
(unsigned char *)state->data + firstIndex, datalen);
|
||||
break;
|
||||
case GLClientState::NORMAL_LOCATION:
|
||||
this->glNormalPointerData(this, state->type, state->stride,
|
||||
(unsigned char *)state->data + firstIndex, datalen);
|
||||
break;
|
||||
case GLClientState::COLOR_LOCATION:
|
||||
this->glColorPointerData(this, state->size, state->type, state->stride,
|
||||
(unsigned char *)state->data + firstIndex, datalen);
|
||||
break;
|
||||
case GLClientState::TEXCOORD0_LOCATION:
|
||||
case GLClientState::TEXCOORD1_LOCATION:
|
||||
case GLClientState::TEXCOORD2_LOCATION:
|
||||
case GLClientState::TEXCOORD3_LOCATION:
|
||||
case GLClientState::TEXCOORD4_LOCATION:
|
||||
case GLClientState::TEXCOORD5_LOCATION:
|
||||
case GLClientState::TEXCOORD6_LOCATION:
|
||||
case GLClientState::TEXCOORD7_LOCATION:
|
||||
this->glTexCoordPointerData(this, i - GLClientState::TEXCOORD0_LOCATION, state->size, state->type, state->stride,
|
||||
(unsigned char *)state->data + firstIndex, datalen);
|
||||
break;
|
||||
case GLClientState::POINTSIZE_LOCATION:
|
||||
this->glPointSizePointerData(this, state->type, state->stride,
|
||||
(unsigned char *) state->data + firstIndex, datalen);
|
||||
break;
|
||||
case GLClientState::WEIGHT_LOCATION:
|
||||
this->glWeightPointerData(this, state->size, state->type, state->stride,
|
||||
(unsigned char * ) state->data + firstIndex, datalen);
|
||||
break;
|
||||
case GLClientState::MATRIXINDEX_LOCATION:
|
||||
this->glMatrixIndexPointerData(this, state->size, state->type, state->stride,
|
||||
(unsigned char *)state->data + firstIndex, datalen);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, state->bufferObject);
|
||||
|
||||
switch(i) {
|
||||
case GLClientState::VERTEX_LOCATION:
|
||||
this->glVertexPointerOffset(this, state->size, state->type, state->stride,
|
||||
(GLuint)state->data + firstIndex);
|
||||
break;
|
||||
case GLClientState::NORMAL_LOCATION:
|
||||
this->glNormalPointerOffset(this, state->type, state->stride,
|
||||
(GLuint) state->data + firstIndex);
|
||||
break;
|
||||
case GLClientState::POINTSIZE_LOCATION:
|
||||
this->glPointSizePointerOffset(this, state->type, state->stride,
|
||||
(GLuint) state->data + firstIndex);
|
||||
break;
|
||||
case GLClientState::COLOR_LOCATION:
|
||||
this->glColorPointerOffset(this, state->size, state->type, state->stride,
|
||||
(GLuint) state->data + firstIndex);
|
||||
break;
|
||||
case GLClientState::TEXCOORD0_LOCATION:
|
||||
case GLClientState::TEXCOORD1_LOCATION:
|
||||
case GLClientState::TEXCOORD2_LOCATION:
|
||||
case GLClientState::TEXCOORD3_LOCATION:
|
||||
case GLClientState::TEXCOORD4_LOCATION:
|
||||
case GLClientState::TEXCOORD5_LOCATION:
|
||||
case GLClientState::TEXCOORD6_LOCATION:
|
||||
case GLClientState::TEXCOORD7_LOCATION:
|
||||
this->glTexCoordPointerOffset(this, state->size, state->type, state->stride,
|
||||
(GLuint) state->data + firstIndex);
|
||||
break;
|
||||
case GLClientState::WEIGHT_LOCATION:
|
||||
this->glWeightPointerOffset(this,state->size,state->type,state->stride,
|
||||
(GLuint)state->data+firstIndex);
|
||||
break;
|
||||
case GLClientState::MATRIXINDEX_LOCATION:
|
||||
this->glMatrixIndexPointerOffset(this,state->size,state->type,state->stride,
|
||||
(GLuint)state->data+firstIndex);
|
||||
break;
|
||||
}
|
||||
this->m_glBindBuffer_enc(this, GL_ARRAY_BUFFER, m_state->currentArrayVbo());
|
||||
}
|
||||
} else {
|
||||
this->m_glDisableClientState_enc(this, state->glConst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
|
||||
ctx->sendVertexData(first, count);
|
||||
ctx->m_glDrawArrays_enc(ctx, mode, /*first*/ 0, count);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices)
|
||||
{
|
||||
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
assert(ctx->m_state != NULL);
|
||||
SET_ERROR_IF(count<0, GL_INVALID_VALUE);
|
||||
|
||||
bool has_immediate_arrays = false;
|
||||
bool has_indirect_arrays = false;
|
||||
|
||||
for (int i = 0; i < GLClientState::LAST_LOCATION; i++) {
|
||||
const GLClientState::VertexAttribState *state = ctx->m_state->getState(i);
|
||||
if (state->enabled) {
|
||||
if (state->bufferObject != 0) {
|
||||
has_indirect_arrays = true;
|
||||
} else {
|
||||
has_immediate_arrays = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!has_immediate_arrays && !has_indirect_arrays) {
|
||||
ALOGE("glDrawElements: no data bound to the command - ignoring\n");
|
||||
return;
|
||||
}
|
||||
|
||||
bool adjustIndices = true;
|
||||
if (ctx->m_state->currentIndexVbo() != 0) {
|
||||
if (!has_immediate_arrays) {
|
||||
ctx->sendVertexData(0, count);
|
||||
ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
|
||||
ctx->glDrawElementsOffset(ctx, mode, count, type, (GLuint)indices);
|
||||
adjustIndices = false;
|
||||
} else {
|
||||
BufferData * buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
|
||||
ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
indices = (void*)((GLintptr)buf->m_fixedBuffer.ptr() + (GLintptr)indices);
|
||||
}
|
||||
}
|
||||
if (adjustIndices) {
|
||||
void *adjustedIndices = (void*)indices;
|
||||
int minIndex = 0, maxIndex = 0;
|
||||
|
||||
switch(type) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
GLUtils::minmax<unsigned char>((unsigned char *)indices, count, &minIndex, &maxIndex);
|
||||
if (minIndex != 0) {
|
||||
adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
|
||||
GLUtils::shiftIndices<unsigned char>((unsigned char *)indices,
|
||||
(unsigned char *)adjustedIndices,
|
||||
count, -minIndex);
|
||||
}
|
||||
break;
|
||||
case GL_SHORT:
|
||||
case GL_UNSIGNED_SHORT:
|
||||
GLUtils::minmax<unsigned short>((unsigned short *)indices, count, &minIndex, &maxIndex);
|
||||
if (minIndex != 0) {
|
||||
adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
|
||||
GLUtils::shiftIndices<unsigned short>((unsigned short *)indices,
|
||||
(unsigned short *)adjustedIndices,
|
||||
count, -minIndex);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ALOGE("unsupported index buffer type %d\n", type);
|
||||
}
|
||||
if (has_indirect_arrays || 1) {
|
||||
ctx->sendVertexData(minIndex, maxIndex - minIndex + 1);
|
||||
ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices,
|
||||
count * glSizeof(type));
|
||||
// XXX - OPTIMIZATION (see the other else branch) should be implemented
|
||||
if(!has_indirect_arrays) {
|
||||
//ALOGD("unoptimized drawelements !!!\n");
|
||||
}
|
||||
} else {
|
||||
// we are all direct arrays and immidate mode index array -
|
||||
// rebuild the arrays and the index array;
|
||||
ALOGE("glDrawElements: direct index & direct buffer data - will be implemented in later versions;\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glActiveTexture(void* self, GLenum texture)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
GLClientState* state = ctx->m_state;
|
||||
GLenum err;
|
||||
|
||||
if ((err = state->setActiveTextureUnit(texture)) != GL_NO_ERROR) {
|
||||
ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
|
||||
ctx->setError(err);
|
||||
return;
|
||||
}
|
||||
|
||||
ctx->m_glActiveTexture_enc(ctx, texture);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glBindTexture(void* self, GLenum target, GLuint texture)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
GLClientState* state = ctx->m_state;
|
||||
GLenum err;
|
||||
|
||||
GLboolean firstUse;
|
||||
if ((err = state->bindTexture(target, texture, &firstUse)) != GL_NO_ERROR) {
|
||||
ALOGE("%s:%s:%d GL error %#x\n", __FILE__, __FUNCTION__, __LINE__, err);
|
||||
ctx->setError(err);
|
||||
return;
|
||||
}
|
||||
|
||||
if (target != GL_TEXTURE_2D && target != GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->m_glBindTexture_enc(ctx, target, texture);
|
||||
return;
|
||||
}
|
||||
|
||||
GLenum priorityTarget = state->getPriorityEnabledTarget(GL_TEXTURE_2D);
|
||||
|
||||
if (target == GL_TEXTURE_EXTERNAL_OES && firstUse) {
|
||||
// set TEXTURE_EXTERNAL_OES default states which differ from TEXTURE_2D
|
||||
ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
|
||||
ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
|
||||
GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
|
||||
GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
|
||||
GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
if (target != priorityTarget) {
|
||||
ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
|
||||
state->getBoundTexture(GL_TEXTURE_2D));
|
||||
}
|
||||
}
|
||||
|
||||
if (target == priorityTarget) {
|
||||
ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
GLClientState* state = ctx->m_state;
|
||||
|
||||
state->deleteTextures(n, textures);
|
||||
ctx->m_glDeleteTextures_enc(ctx, n, textures);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glDisable(void* self, GLenum cap)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
GLClientState* state = ctx->m_state;
|
||||
|
||||
if (cap == GL_TEXTURE_2D || cap == GL_TEXTURE_EXTERNAL_OES) {
|
||||
GLenum prevTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
|
||||
state->disableTextureTarget(cap);
|
||||
GLenum currTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
|
||||
|
||||
if (prevTarget != currTarget) {
|
||||
if (currTarget == GL_INVALID_ENUM) {
|
||||
ctx->m_glDisable_enc(ctx, GL_TEXTURE_2D);
|
||||
currTarget = GL_TEXTURE_2D;
|
||||
}
|
||||
// maintain the invariant that when TEXTURE_EXTERNAL_OES is
|
||||
// disabled, the TEXTURE_2D binding is active, even if
|
||||
// TEXTURE_2D is also disabled.
|
||||
ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
|
||||
state->getBoundTexture(currTarget));
|
||||
}
|
||||
|
||||
} else {
|
||||
ctx->m_glDisable_enc(ctx, cap);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glEnable(void* self, GLenum cap)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
GLClientState* state = ctx->m_state;
|
||||
|
||||
if (cap == GL_TEXTURE_2D || cap == GL_TEXTURE_EXTERNAL_OES) {
|
||||
GLenum prevTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
|
||||
state->enableTextureTarget(cap);
|
||||
GLenum currTarget = state->getPriorityEnabledTarget(GL_INVALID_ENUM);
|
||||
|
||||
if (prevTarget != currTarget) {
|
||||
if (prevTarget == GL_INVALID_ENUM) {
|
||||
ctx->m_glEnable_enc(ctx, GL_TEXTURE_2D);
|
||||
}
|
||||
if (currTarget == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
|
||||
state->getBoundTexture(currTarget));
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
ctx->m_glEnable_enc(ctx, cap);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetTexParameterfv(void* self,
|
||||
GLenum target, GLenum pname, GLfloat* params)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glGetTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glGetTexParameterfv_enc(ctx, target, pname, params);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetTexParameteriv(void* self,
|
||||
GLenum target, GLenum pname, GLint* params)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
switch (pname) {
|
||||
case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES:
|
||||
*params = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glGetTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glGetTexParameteriv_enc(ctx, target, pname, params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glGetTexParameterxv(void* self,
|
||||
GLenum target, GLenum pname, GLfixed* params)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glGetTexParameterxv_enc(ctx, GL_TEXTURE_2D, pname, params);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glGetTexParameterxv_enc(ctx, target, pname, params);
|
||||
}
|
||||
}
|
||||
|
||||
static bool isValidTextureExternalParam(GLenum pname, GLenum param)
|
||||
{
|
||||
switch (pname) {
|
||||
case GL_TEXTURE_MIN_FILTER:
|
||||
case GL_TEXTURE_MAG_FILTER:
|
||||
return param == GL_NEAREST || param == GL_LINEAR;
|
||||
|
||||
case GL_TEXTURE_WRAP_S:
|
||||
case GL_TEXTURE_WRAP_T:
|
||||
return param == GL_CLAMP_TO_EDGE;
|
||||
|
||||
case GL_GENERATE_MIPMAP:
|
||||
return param == GL_FALSE;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexParameterf(void* self,
|
||||
GLenum target, GLenum pname, GLfloat param)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
|
||||
!isValidTextureExternalParam(pname, (GLenum)param)),
|
||||
GL_INVALID_ENUM);
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glTexParameterf_enc(ctx, GL_TEXTURE_2D, pname, param);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glTexParameterf_enc(ctx, target, pname, param);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexParameterfv(void* self,
|
||||
GLenum target, GLenum pname, const GLfloat* params)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
|
||||
!isValidTextureExternalParam(pname, (GLenum)params[0])),
|
||||
GL_INVALID_ENUM);
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glTexParameterfv_enc(ctx, target, pname, params);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexParameteri(void* self,
|
||||
GLenum target, GLenum pname, GLint param)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
|
||||
!isValidTextureExternalParam(pname, (GLenum)param)),
|
||||
GL_INVALID_ENUM);
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, pname, param);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glTexParameteri_enc(ctx, target, pname, param);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexParameterx(void* self,
|
||||
GLenum target, GLenum pname, GLfixed param)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
|
||||
!isValidTextureExternalParam(pname, (GLenum)param)),
|
||||
GL_INVALID_ENUM);
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glTexParameterx_enc(ctx, GL_TEXTURE_2D, pname, param);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glTexParameterx_enc(ctx, target, pname, param);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexParameteriv(void* self,
|
||||
GLenum target, GLenum pname, const GLint* params)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
|
||||
!isValidTextureExternalParam(pname, (GLenum)params[0])),
|
||||
GL_INVALID_ENUM);
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glTexParameteriv_enc(ctx, target, pname, params);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::s_glTexParameterxv(void* self,
|
||||
GLenum target, GLenum pname, const GLfixed* params)
|
||||
{
|
||||
GLEncoder* ctx = (GLEncoder*)self;
|
||||
const GLClientState* state = ctx->m_state;
|
||||
|
||||
SET_ERROR_IF((target == GL_TEXTURE_EXTERNAL_OES &&
|
||||
!isValidTextureExternalParam(pname, (GLenum)params[0])),
|
||||
GL_INVALID_ENUM);
|
||||
|
||||
if (target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) {
|
||||
ctx->override2DTextureTarget(target);
|
||||
ctx->m_glTexParameterxv_enc(ctx, GL_TEXTURE_2D, pname, params);
|
||||
ctx->restore2DTextureTarget();
|
||||
} else {
|
||||
ctx->m_glTexParameterxv_enc(ctx, target, pname, params);
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::override2DTextureTarget(GLenum target)
|
||||
{
|
||||
if ((target == GL_TEXTURE_2D || target == GL_TEXTURE_EXTERNAL_OES) &&
|
||||
target != m_state->getPriorityEnabledTarget(GL_TEXTURE_2D)) {
|
||||
m_glBindTexture_enc(this, GL_TEXTURE_2D,
|
||||
m_state->getBoundTexture(target));
|
||||
}
|
||||
}
|
||||
|
||||
void GLEncoder::restore2DTextureTarget()
|
||||
{
|
||||
GLenum priorityTarget = m_state->getPriorityEnabledTarget(GL_TEXTURE_2D);
|
||||
m_glBindTexture_enc(this, GL_TEXTURE_2D,
|
||||
m_state->getBoundTexture(priorityTarget));
|
||||
}
|
||||
|
||||
GLEncoder::GLEncoder(IOStream *stream) : gl_encoder_context_t(stream)
|
||||
{
|
||||
m_initialized = false;
|
||||
m_state = NULL;
|
||||
m_error = GL_NO_ERROR;
|
||||
m_num_compressedTextureFormats = 0;
|
||||
m_compressedTextureFormats = NULL;
|
||||
// overrides;
|
||||
m_glFlush_enc = set_glFlush(s_glFlush);
|
||||
m_glPixelStorei_enc = set_glPixelStorei(s_glPixelStorei);
|
||||
m_glVertexPointer_enc = set_glVertexPointer(s_glVertexPointer);
|
||||
m_glNormalPointer_enc = set_glNormalPointer(s_glNormalPointer);
|
||||
m_glColorPointer_enc = set_glColorPointer(s_glColorPointer);
|
||||
m_glPointSizePointerOES_enc = set_glPointSizePointerOES(s_glPointsizePointer);
|
||||
m_glClientActiveTexture_enc = set_glClientActiveTexture(s_glClientActiveTexture);
|
||||
m_glTexCoordPointer_enc = set_glTexCoordPointer(s_glTexcoordPointer);
|
||||
m_glMatrixIndexPointerOES_enc = set_glMatrixIndexPointerOES(s_glMatrixIndexPointerOES);
|
||||
m_glWeightPointerOES_enc = set_glWeightPointerOES(s_glWeightPointerOES);
|
||||
|
||||
m_glGetIntegerv_enc = set_glGetIntegerv(s_glGetIntegerv);
|
||||
m_glGetFloatv_enc = set_glGetFloatv(s_glGetFloatv);
|
||||
m_glGetBooleanv_enc = set_glGetBooleanv(s_glGetBooleanv);
|
||||
m_glGetFixedv_enc = set_glGetFixedv(s_glGetFixedv);
|
||||
m_glGetPointerv_enc = set_glGetPointerv(s_glGetPointerv);
|
||||
|
||||
m_glBindBuffer_enc = set_glBindBuffer(s_glBindBuffer);
|
||||
m_glBufferData_enc = set_glBufferData(s_glBufferData);
|
||||
m_glBufferSubData_enc = set_glBufferSubData(s_glBufferSubData);
|
||||
m_glDeleteBuffers_enc = set_glDeleteBuffers(s_glDeleteBuffers);
|
||||
|
||||
m_glEnableClientState_enc = set_glEnableClientState(s_glEnableClientState);
|
||||
m_glDisableClientState_enc = set_glDisableClientState(s_glDisableClientState);
|
||||
m_glIsEnabled_enc = set_glIsEnabled(s_glIsEnabled);
|
||||
m_glDrawArrays_enc = set_glDrawArrays(s_glDrawArrays);
|
||||
m_glDrawElements_enc = set_glDrawElements(s_glDrawElements);
|
||||
set_glGetString(s_glGetString);
|
||||
set_glFinish(s_glFinish);
|
||||
m_glGetError_enc = set_glGetError(s_glGetError);
|
||||
|
||||
m_glActiveTexture_enc = set_glActiveTexture(s_glActiveTexture);
|
||||
m_glBindTexture_enc = set_glBindTexture(s_glBindTexture);
|
||||
m_glDeleteTextures_enc = set_glDeleteTextures(s_glDeleteTextures);
|
||||
m_glDisable_enc = set_glDisable(s_glDisable);
|
||||
m_glEnable_enc = set_glEnable(s_glEnable);
|
||||
m_glGetTexParameterfv_enc = set_glGetTexParameterfv(s_glGetTexParameterfv);
|
||||
m_glGetTexParameteriv_enc = set_glGetTexParameteriv(s_glGetTexParameteriv);
|
||||
m_glGetTexParameterxv_enc = set_glGetTexParameterxv(s_glGetTexParameterxv);
|
||||
m_glTexParameterf_enc = set_glTexParameterf(s_glTexParameterf);
|
||||
m_glTexParameterfv_enc = set_glTexParameterfv(s_glTexParameterfv);
|
||||
m_glTexParameteri_enc = set_glTexParameteri(s_glTexParameteri);
|
||||
m_glTexParameterx_enc = set_glTexParameterx(s_glTexParameterx);
|
||||
m_glTexParameteriv_enc = set_glTexParameteriv(s_glTexParameteriv);
|
||||
m_glTexParameterxv_enc = set_glTexParameterxv(s_glTexParameterxv);
|
||||
}
|
||||
|
||||
GLEncoder::~GLEncoder()
|
||||
{
|
||||
delete [] m_compressedTextureFormats;
|
||||
}
|
||||
|
||||
size_t GLEncoder::pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
|
||||
{
|
||||
assert(m_state != NULL);
|
||||
return m_state->pixelDataSize(width, height, format, type, pack);
|
||||
}
|
||||
|
||||
void GLEncoder::s_glFinish(void *self)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
ctx->glFinishRoundTrip(self);
|
||||
}
|
||||
149
tools/emulator/opengl/system/GLESv1_enc/GLEncoder.h
Normal file
149
tools/emulator/opengl/system/GLESv1_enc/GLEncoder.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _GL_ENCODER_H_
|
||||
#define _GL_ENCODER_H_
|
||||
|
||||
#include "gl_enc.h"
|
||||
#include "GLClientState.h"
|
||||
#include "GLSharedGroup.h"
|
||||
#include "FixedBuffer.h"
|
||||
|
||||
class GLEncoder : public gl_encoder_context_t {
|
||||
|
||||
public:
|
||||
GLEncoder(IOStream *stream);
|
||||
virtual ~GLEncoder();
|
||||
void setClientState(GLClientState *state) {
|
||||
m_state = state;
|
||||
}
|
||||
void setSharedGroup(GLSharedGroupPtr shared) { m_shared = shared; }
|
||||
void flush() { m_stream->flush(); }
|
||||
size_t pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
|
||||
|
||||
void setInitialized(){ m_initialized = true; };
|
||||
bool isInitialized(){ return m_initialized; };
|
||||
|
||||
virtual void setError(GLenum error){ m_error = error; };
|
||||
virtual GLenum getError() { return m_error; };
|
||||
|
||||
void override2DTextureTarget(GLenum target);
|
||||
void restore2DTextureTarget();
|
||||
|
||||
private:
|
||||
|
||||
bool m_initialized;
|
||||
GLClientState *m_state;
|
||||
GLSharedGroupPtr m_shared;
|
||||
GLenum m_error;
|
||||
FixedBuffer m_fixedBuffer;
|
||||
GLint *m_compressedTextureFormats;
|
||||
GLint m_num_compressedTextureFormats;
|
||||
|
||||
GLint *getCompressedTextureFormats();
|
||||
// original functions;
|
||||
glGetError_client_proc_t m_glGetError_enc;
|
||||
glGetIntegerv_client_proc_t m_glGetIntegerv_enc;
|
||||
glGetFloatv_client_proc_t m_glGetFloatv_enc;
|
||||
glGetFixedv_client_proc_t m_glGetFixedv_enc;
|
||||
glGetBooleanv_client_proc_t m_glGetBooleanv_enc;
|
||||
glGetPointerv_client_proc_t m_glGetPointerv_enc;
|
||||
|
||||
glPixelStorei_client_proc_t m_glPixelStorei_enc;
|
||||
glVertexPointer_client_proc_t m_glVertexPointer_enc;
|
||||
glNormalPointer_client_proc_t m_glNormalPointer_enc;
|
||||
glColorPointer_client_proc_t m_glColorPointer_enc;
|
||||
glPointSizePointerOES_client_proc_t m_glPointSizePointerOES_enc;
|
||||
glTexCoordPointer_client_proc_t m_glTexCoordPointer_enc;
|
||||
glClientActiveTexture_client_proc_t m_glClientActiveTexture_enc;
|
||||
glMatrixIndexPointerOES_client_proc_t m_glMatrixIndexPointerOES_enc;
|
||||
glWeightPointerOES_client_proc_t m_glWeightPointerOES_enc;
|
||||
|
||||
glBindBuffer_client_proc_t m_glBindBuffer_enc;
|
||||
glBufferData_client_proc_t m_glBufferData_enc;
|
||||
glBufferSubData_client_proc_t m_glBufferSubData_enc;
|
||||
glDeleteBuffers_client_proc_t m_glDeleteBuffers_enc;
|
||||
|
||||
glEnableClientState_client_proc_t m_glEnableClientState_enc;
|
||||
glDisableClientState_client_proc_t m_glDisableClientState_enc;
|
||||
glIsEnabled_client_proc_t m_glIsEnabled_enc;
|
||||
glDrawArrays_client_proc_t m_glDrawArrays_enc;
|
||||
glDrawElements_client_proc_t m_glDrawElements_enc;
|
||||
glFlush_client_proc_t m_glFlush_enc;
|
||||
|
||||
glActiveTexture_client_proc_t m_glActiveTexture_enc;
|
||||
glBindTexture_client_proc_t m_glBindTexture_enc;
|
||||
glDeleteTextures_client_proc_t m_glDeleteTextures_enc;
|
||||
glDisable_client_proc_t m_glDisable_enc;
|
||||
glEnable_client_proc_t m_glEnable_enc;
|
||||
glGetTexParameterfv_client_proc_t m_glGetTexParameterfv_enc;
|
||||
glGetTexParameteriv_client_proc_t m_glGetTexParameteriv_enc;
|
||||
glGetTexParameterxv_client_proc_t m_glGetTexParameterxv_enc;
|
||||
glTexParameterf_client_proc_t m_glTexParameterf_enc;
|
||||
glTexParameterfv_client_proc_t m_glTexParameterfv_enc;
|
||||
glTexParameteri_client_proc_t m_glTexParameteri_enc;
|
||||
glTexParameterx_client_proc_t m_glTexParameterx_enc;
|
||||
glTexParameteriv_client_proc_t m_glTexParameteriv_enc;
|
||||
glTexParameterxv_client_proc_t m_glTexParameterxv_enc;
|
||||
|
||||
// statics
|
||||
static GLenum s_glGetError(void * self);
|
||||
static void s_glGetIntegerv(void *self, GLenum pname, GLint *ptr);
|
||||
static void s_glGetBooleanv(void *self, GLenum pname, GLboolean *ptr);
|
||||
static void s_glGetFloatv(void *self, GLenum pname, GLfloat *ptr);
|
||||
static void s_glGetFixedv(void *self, GLenum pname, GLfixed *ptr);
|
||||
static void s_glGetPointerv(void *self, GLenum pname, GLvoid **params);
|
||||
|
||||
static void s_glFlush(void * self);
|
||||
static const GLubyte * s_glGetString(void *self, GLenum name);
|
||||
static void s_glVertexPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glNormalPointer(void *self, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glColorPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glPointsizePointer(void *self, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glClientActiveTexture(void *self, GLenum texture);
|
||||
static void s_glTexcoordPointer(void *self, int size, GLenum type, GLsizei stride, const void *data);
|
||||
static void s_glMatrixIndexPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
|
||||
static void s_glWeightPointerOES(void *self, int size, GLenum type, GLsizei stride, const void * data);
|
||||
static void s_glDisableClientState(void *self, GLenum state);
|
||||
static void s_glEnableClientState(void *self, GLenum state);
|
||||
static GLboolean s_glIsEnabled(void *self, GLenum cap);
|
||||
static void s_glBindBuffer(void *self, GLenum target, GLuint id);
|
||||
static void s_glBufferData(void *self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
static void s_glBufferSubData(void *self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
|
||||
static void s_glDeleteBuffers(void *self, GLsizei n, const GLuint * buffers);
|
||||
|
||||
static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
|
||||
static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
static void s_glPixelStorei(void *self, GLenum param, GLint value);
|
||||
|
||||
static void s_glFinish(void *self);
|
||||
void sendVertexData(unsigned first, unsigned count);
|
||||
|
||||
static void s_glActiveTexture(void* self, GLenum texture);
|
||||
static void s_glBindTexture(void* self, GLenum target, GLuint texture);
|
||||
static void s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures);
|
||||
static void s_glDisable(void* self, GLenum cap);
|
||||
static void s_glEnable(void* self, GLenum cap);
|
||||
static void s_glGetTexParameterfv(void* self, GLenum target, GLenum pname, GLfloat* params);
|
||||
static void s_glGetTexParameteriv(void* self, GLenum target, GLenum pname, GLint* params);
|
||||
static void s_glGetTexParameterxv(void* self, GLenum target, GLenum pname, GLfixed* params);
|
||||
static void s_glTexParameterf(void* self, GLenum target, GLenum pname, GLfloat param);
|
||||
static void s_glTexParameterfv(void* self, GLenum target, GLenum pname, const GLfloat* params);
|
||||
static void s_glTexParameteri(void* self, GLenum target, GLenum pname, GLint param);
|
||||
static void s_glTexParameterx(void* self, GLenum target, GLenum pname, GLfixed param);
|
||||
static void s_glTexParameteriv(void* self, GLenum target, GLenum pname, const GLint* params);
|
||||
static void s_glTexParameterxv(void* self, GLenum target, GLenum pname, const GLfixed* params);
|
||||
};
|
||||
#endif
|
||||
24
tools/emulator/opengl/system/GLESv1_enc/GLEncoderUtils.cpp
Normal file
24
tools/emulator/opengl/system/GLESv1_enc/GLEncoderUtils.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "GLEncoder.h"
|
||||
|
||||
size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
|
||||
{
|
||||
GLEncoder *ctx = (GLEncoder *)self;
|
||||
return ctx->pixelDataSize(width, height, format, type, pack);
|
||||
}
|
||||
22
tools/emulator/opengl/system/GLESv1_enc/GLEncoderUtils.h
Normal file
22
tools/emulator/opengl/system/GLESv1_enc/GLEncoderUtils.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef GL_ENCODER_UTILS_H
|
||||
#define GL_ENCLODER_UTILS_H
|
||||
|
||||
extern "C" {
|
||||
size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
|
||||
};
|
||||
#endif
|
||||
308
tools/emulator/opengl/system/GLESv1_enc/gl_client_context.cpp
Normal file
308
tools/emulator/opengl/system/GLESv1_enc/gl_client_context.cpp
Normal file
@@ -0,0 +1,308 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "gl_client_context.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int gl_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = getProc("glAlphaFunc", userData); set_glAlphaFunc((glAlphaFunc_client_proc_t)ptr);
|
||||
ptr = getProc("glClearColor", userData); set_glClearColor((glClearColor_client_proc_t)ptr);
|
||||
ptr = getProc("glClearDepthf", userData); set_glClearDepthf((glClearDepthf_client_proc_t)ptr);
|
||||
ptr = getProc("glClipPlanef", userData); set_glClipPlanef((glClipPlanef_client_proc_t)ptr);
|
||||
ptr = getProc("glColor4f", userData); set_glColor4f((glColor4f_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthRangef", userData); set_glDepthRangef((glDepthRangef_client_proc_t)ptr);
|
||||
ptr = getProc("glFogf", userData); set_glFogf((glFogf_client_proc_t)ptr);
|
||||
ptr = getProc("glFogfv", userData); set_glFogfv((glFogfv_client_proc_t)ptr);
|
||||
ptr = getProc("glFrustumf", userData); set_glFrustumf((glFrustumf_client_proc_t)ptr);
|
||||
ptr = getProc("glGetClipPlanef", userData); set_glGetClipPlanef((glGetClipPlanef_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFloatv", userData); set_glGetFloatv((glGetFloatv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetLightfv", userData); set_glGetLightfv((glGetLightfv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetMaterialfv", userData); set_glGetMaterialfv((glGetMaterialfv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexEnvfv", userData); set_glGetTexEnvfv((glGetTexEnvfv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexParameterfv", userData); set_glGetTexParameterfv((glGetTexParameterfv_client_proc_t)ptr);
|
||||
ptr = getProc("glLightModelf", userData); set_glLightModelf((glLightModelf_client_proc_t)ptr);
|
||||
ptr = getProc("glLightModelfv", userData); set_glLightModelfv((glLightModelfv_client_proc_t)ptr);
|
||||
ptr = getProc("glLightf", userData); set_glLightf((glLightf_client_proc_t)ptr);
|
||||
ptr = getProc("glLightfv", userData); set_glLightfv((glLightfv_client_proc_t)ptr);
|
||||
ptr = getProc("glLineWidth", userData); set_glLineWidth((glLineWidth_client_proc_t)ptr);
|
||||
ptr = getProc("glLoadMatrixf", userData); set_glLoadMatrixf((glLoadMatrixf_client_proc_t)ptr);
|
||||
ptr = getProc("glMaterialf", userData); set_glMaterialf((glMaterialf_client_proc_t)ptr);
|
||||
ptr = getProc("glMaterialfv", userData); set_glMaterialfv((glMaterialfv_client_proc_t)ptr);
|
||||
ptr = getProc("glMultMatrixf", userData); set_glMultMatrixf((glMultMatrixf_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiTexCoord4f", userData); set_glMultiTexCoord4f((glMultiTexCoord4f_client_proc_t)ptr);
|
||||
ptr = getProc("glNormal3f", userData); set_glNormal3f((glNormal3f_client_proc_t)ptr);
|
||||
ptr = getProc("glOrthof", userData); set_glOrthof((glOrthof_client_proc_t)ptr);
|
||||
ptr = getProc("glPointParameterf", userData); set_glPointParameterf((glPointParameterf_client_proc_t)ptr);
|
||||
ptr = getProc("glPointParameterfv", userData); set_glPointParameterfv((glPointParameterfv_client_proc_t)ptr);
|
||||
ptr = getProc("glPointSize", userData); set_glPointSize((glPointSize_client_proc_t)ptr);
|
||||
ptr = getProc("glPolygonOffset", userData); set_glPolygonOffset((glPolygonOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glRotatef", userData); set_glRotatef((glRotatef_client_proc_t)ptr);
|
||||
ptr = getProc("glScalef", userData); set_glScalef((glScalef_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnvf", userData); set_glTexEnvf((glTexEnvf_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnvfv", userData); set_glTexEnvfv((glTexEnvfv_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterf", userData); set_glTexParameterf((glTexParameterf_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterfv", userData); set_glTexParameterfv((glTexParameterfv_client_proc_t)ptr);
|
||||
ptr = getProc("glTranslatef", userData); set_glTranslatef((glTranslatef_client_proc_t)ptr);
|
||||
ptr = getProc("glActiveTexture", userData); set_glActiveTexture((glActiveTexture_client_proc_t)ptr);
|
||||
ptr = getProc("glAlphaFuncx", userData); set_glAlphaFuncx((glAlphaFuncx_client_proc_t)ptr);
|
||||
ptr = getProc("glBindBuffer", userData); set_glBindBuffer((glBindBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glBindTexture", userData); set_glBindTexture((glBindTexture_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendFunc", userData); set_glBlendFunc((glBlendFunc_client_proc_t)ptr);
|
||||
ptr = getProc("glBufferData", userData); set_glBufferData((glBufferData_client_proc_t)ptr);
|
||||
ptr = getProc("glBufferSubData", userData); set_glBufferSubData((glBufferSubData_client_proc_t)ptr);
|
||||
ptr = getProc("glClear", userData); set_glClear((glClear_client_proc_t)ptr);
|
||||
ptr = getProc("glClearColorx", userData); set_glClearColorx((glClearColorx_client_proc_t)ptr);
|
||||
ptr = getProc("glClearDepthx", userData); set_glClearDepthx((glClearDepthx_client_proc_t)ptr);
|
||||
ptr = getProc("glClearStencil", userData); set_glClearStencil((glClearStencil_client_proc_t)ptr);
|
||||
ptr = getProc("glClientActiveTexture", userData); set_glClientActiveTexture((glClientActiveTexture_client_proc_t)ptr);
|
||||
ptr = getProc("glColor4ub", userData); set_glColor4ub((glColor4ub_client_proc_t)ptr);
|
||||
ptr = getProc("glColor4x", userData); set_glColor4x((glColor4x_client_proc_t)ptr);
|
||||
ptr = getProc("glColorMask", userData); set_glColorMask((glColorMask_client_proc_t)ptr);
|
||||
ptr = getProc("glColorPointer", userData); set_glColorPointer((glColorPointer_client_proc_t)ptr);
|
||||
ptr = getProc("glCompressedTexImage2D", userData); set_glCompressedTexImage2D((glCompressedTexImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCompressedTexSubImage2D", userData); set_glCompressedTexSubImage2D((glCompressedTexSubImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCopyTexImage2D", userData); set_glCopyTexImage2D((glCopyTexImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCopyTexSubImage2D", userData); set_glCopyTexSubImage2D((glCopyTexSubImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCullFace", userData); set_glCullFace((glCullFace_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteBuffers", userData); set_glDeleteBuffers((glDeleteBuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteTextures", userData); set_glDeleteTextures((glDeleteTextures_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthFunc", userData); set_glDepthFunc((glDepthFunc_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthMask", userData); set_glDepthMask((glDepthMask_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthRangex", userData); set_glDepthRangex((glDepthRangex_client_proc_t)ptr);
|
||||
ptr = getProc("glDisable", userData); set_glDisable((glDisable_client_proc_t)ptr);
|
||||
ptr = getProc("glDisableClientState", userData); set_glDisableClientState((glDisableClientState_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawArrays", userData); set_glDrawArrays((glDrawArrays_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawElements", userData); set_glDrawElements((glDrawElements_client_proc_t)ptr);
|
||||
ptr = getProc("glEnable", userData); set_glEnable((glEnable_client_proc_t)ptr);
|
||||
ptr = getProc("glEnableClientState", userData); set_glEnableClientState((glEnableClientState_client_proc_t)ptr);
|
||||
ptr = getProc("glFinish", userData); set_glFinish((glFinish_client_proc_t)ptr);
|
||||
ptr = getProc("glFlush", userData); set_glFlush((glFlush_client_proc_t)ptr);
|
||||
ptr = getProc("glFogx", userData); set_glFogx((glFogx_client_proc_t)ptr);
|
||||
ptr = getProc("glFogxv", userData); set_glFogxv((glFogxv_client_proc_t)ptr);
|
||||
ptr = getProc("glFrontFace", userData); set_glFrontFace((glFrontFace_client_proc_t)ptr);
|
||||
ptr = getProc("glFrustumx", userData); set_glFrustumx((glFrustumx_client_proc_t)ptr);
|
||||
ptr = getProc("glGetBooleanv", userData); set_glGetBooleanv((glGetBooleanv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetBufferParameteriv", userData); set_glGetBufferParameteriv((glGetBufferParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glClipPlanex", userData); set_glClipPlanex((glClipPlanex_client_proc_t)ptr);
|
||||
ptr = getProc("glGenBuffers", userData); set_glGenBuffers((glGenBuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glGenTextures", userData); set_glGenTextures((glGenTextures_client_proc_t)ptr);
|
||||
ptr = getProc("glGetError", userData); set_glGetError((glGetError_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFixedv", userData); set_glGetFixedv((glGetFixedv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetIntegerv", userData); set_glGetIntegerv((glGetIntegerv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetLightxv", userData); set_glGetLightxv((glGetLightxv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetMaterialxv", userData); set_glGetMaterialxv((glGetMaterialxv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetPointerv", userData); set_glGetPointerv((glGetPointerv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetString", userData); set_glGetString((glGetString_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexEnviv", userData); set_glGetTexEnviv((glGetTexEnviv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexEnvxv", userData); set_glGetTexEnvxv((glGetTexEnvxv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexParameteriv", userData); set_glGetTexParameteriv((glGetTexParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexParameterxv", userData); set_glGetTexParameterxv((glGetTexParameterxv_client_proc_t)ptr);
|
||||
ptr = getProc("glHint", userData); set_glHint((glHint_client_proc_t)ptr);
|
||||
ptr = getProc("glIsBuffer", userData); set_glIsBuffer((glIsBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glIsEnabled", userData); set_glIsEnabled((glIsEnabled_client_proc_t)ptr);
|
||||
ptr = getProc("glIsTexture", userData); set_glIsTexture((glIsTexture_client_proc_t)ptr);
|
||||
ptr = getProc("glLightModelx", userData); set_glLightModelx((glLightModelx_client_proc_t)ptr);
|
||||
ptr = getProc("glLightModelxv", userData); set_glLightModelxv((glLightModelxv_client_proc_t)ptr);
|
||||
ptr = getProc("glLightx", userData); set_glLightx((glLightx_client_proc_t)ptr);
|
||||
ptr = getProc("glLightxv", userData); set_glLightxv((glLightxv_client_proc_t)ptr);
|
||||
ptr = getProc("glLineWidthx", userData); set_glLineWidthx((glLineWidthx_client_proc_t)ptr);
|
||||
ptr = getProc("glLoadIdentity", userData); set_glLoadIdentity((glLoadIdentity_client_proc_t)ptr);
|
||||
ptr = getProc("glLoadMatrixx", userData); set_glLoadMatrixx((glLoadMatrixx_client_proc_t)ptr);
|
||||
ptr = getProc("glLogicOp", userData); set_glLogicOp((glLogicOp_client_proc_t)ptr);
|
||||
ptr = getProc("glMaterialx", userData); set_glMaterialx((glMaterialx_client_proc_t)ptr);
|
||||
ptr = getProc("glMaterialxv", userData); set_glMaterialxv((glMaterialxv_client_proc_t)ptr);
|
||||
ptr = getProc("glMatrixMode", userData); set_glMatrixMode((glMatrixMode_client_proc_t)ptr);
|
||||
ptr = getProc("glMultMatrixx", userData); set_glMultMatrixx((glMultMatrixx_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiTexCoord4x", userData); set_glMultiTexCoord4x((glMultiTexCoord4x_client_proc_t)ptr);
|
||||
ptr = getProc("glNormal3x", userData); set_glNormal3x((glNormal3x_client_proc_t)ptr);
|
||||
ptr = getProc("glNormalPointer", userData); set_glNormalPointer((glNormalPointer_client_proc_t)ptr);
|
||||
ptr = getProc("glOrthox", userData); set_glOrthox((glOrthox_client_proc_t)ptr);
|
||||
ptr = getProc("glPixelStorei", userData); set_glPixelStorei((glPixelStorei_client_proc_t)ptr);
|
||||
ptr = getProc("glPointParameterx", userData); set_glPointParameterx((glPointParameterx_client_proc_t)ptr);
|
||||
ptr = getProc("glPointParameterxv", userData); set_glPointParameterxv((glPointParameterxv_client_proc_t)ptr);
|
||||
ptr = getProc("glPointSizex", userData); set_glPointSizex((glPointSizex_client_proc_t)ptr);
|
||||
ptr = getProc("glPolygonOffsetx", userData); set_glPolygonOffsetx((glPolygonOffsetx_client_proc_t)ptr);
|
||||
ptr = getProc("glPopMatrix", userData); set_glPopMatrix((glPopMatrix_client_proc_t)ptr);
|
||||
ptr = getProc("glPushMatrix", userData); set_glPushMatrix((glPushMatrix_client_proc_t)ptr);
|
||||
ptr = getProc("glReadPixels", userData); set_glReadPixels((glReadPixels_client_proc_t)ptr);
|
||||
ptr = getProc("glRotatex", userData); set_glRotatex((glRotatex_client_proc_t)ptr);
|
||||
ptr = getProc("glSampleCoverage", userData); set_glSampleCoverage((glSampleCoverage_client_proc_t)ptr);
|
||||
ptr = getProc("glSampleCoveragex", userData); set_glSampleCoveragex((glSampleCoveragex_client_proc_t)ptr);
|
||||
ptr = getProc("glScalex", userData); set_glScalex((glScalex_client_proc_t)ptr);
|
||||
ptr = getProc("glScissor", userData); set_glScissor((glScissor_client_proc_t)ptr);
|
||||
ptr = getProc("glShadeModel", userData); set_glShadeModel((glShadeModel_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilFunc", userData); set_glStencilFunc((glStencilFunc_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilMask", userData); set_glStencilMask((glStencilMask_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilOp", userData); set_glStencilOp((glStencilOp_client_proc_t)ptr);
|
||||
ptr = getProc("glTexCoordPointer", userData); set_glTexCoordPointer((glTexCoordPointer_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnvi", userData); set_glTexEnvi((glTexEnvi_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnvx", userData); set_glTexEnvx((glTexEnvx_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnviv", userData); set_glTexEnviv((glTexEnviv_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnvxv", userData); set_glTexEnvxv((glTexEnvxv_client_proc_t)ptr);
|
||||
ptr = getProc("glTexImage2D", userData); set_glTexImage2D((glTexImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameteri", userData); set_glTexParameteri((glTexParameteri_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterx", userData); set_glTexParameterx((glTexParameterx_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameteriv", userData); set_glTexParameteriv((glTexParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterxv", userData); set_glTexParameterxv((glTexParameterxv_client_proc_t)ptr);
|
||||
ptr = getProc("glTexSubImage2D", userData); set_glTexSubImage2D((glTexSubImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glTranslatex", userData); set_glTranslatex((glTranslatex_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexPointer", userData); set_glVertexPointer((glVertexPointer_client_proc_t)ptr);
|
||||
ptr = getProc("glViewport", userData); set_glViewport((glViewport_client_proc_t)ptr);
|
||||
ptr = getProc("glPointSizePointerOES", userData); set_glPointSizePointerOES((glPointSizePointerOES_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexPointerOffset", userData); set_glVertexPointerOffset((glVertexPointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glColorPointerOffset", userData); set_glColorPointerOffset((glColorPointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glNormalPointerOffset", userData); set_glNormalPointerOffset((glNormalPointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glPointSizePointerOffset", userData); set_glPointSizePointerOffset((glPointSizePointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glTexCoordPointerOffset", userData); set_glTexCoordPointerOffset((glTexCoordPointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glWeightPointerOffset", userData); set_glWeightPointerOffset((glWeightPointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glMatrixIndexPointerOffset", userData); set_glMatrixIndexPointerOffset((glMatrixIndexPointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexPointerData", userData); set_glVertexPointerData((glVertexPointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glColorPointerData", userData); set_glColorPointerData((glColorPointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glNormalPointerData", userData); set_glNormalPointerData((glNormalPointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glTexCoordPointerData", userData); set_glTexCoordPointerData((glTexCoordPointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glPointSizePointerData", userData); set_glPointSizePointerData((glPointSizePointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glWeightPointerData", userData); set_glWeightPointerData((glWeightPointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glMatrixIndexPointerData", userData); set_glMatrixIndexPointerData((glMatrixIndexPointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawElementsOffset", userData); set_glDrawElementsOffset((glDrawElementsOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawElementsData", userData); set_glDrawElementsData((glDrawElementsData_client_proc_t)ptr);
|
||||
ptr = getProc("glGetCompressedTextureFormats", userData); set_glGetCompressedTextureFormats((glGetCompressedTextureFormats_client_proc_t)ptr);
|
||||
ptr = getProc("glFinishRoundTrip", userData); set_glFinishRoundTrip((glFinishRoundTrip_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendEquationSeparateOES", userData); set_glBlendEquationSeparateOES((glBlendEquationSeparateOES_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendFuncSeparateOES", userData); set_glBlendFuncSeparateOES((glBlendFuncSeparateOES_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendEquationOES", userData); set_glBlendEquationOES((glBlendEquationOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexsOES", userData); set_glDrawTexsOES((glDrawTexsOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexiOES", userData); set_glDrawTexiOES((glDrawTexiOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexxOES", userData); set_glDrawTexxOES((glDrawTexxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexsvOES", userData); set_glDrawTexsvOES((glDrawTexsvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexivOES", userData); set_glDrawTexivOES((glDrawTexivOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexxvOES", userData); set_glDrawTexxvOES((glDrawTexxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexfOES", userData); set_glDrawTexfOES((glDrawTexfOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawTexfvOES", userData); set_glDrawTexfvOES((glDrawTexfvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glEGLImageTargetTexture2DOES", userData); set_glEGLImageTargetTexture2DOES((glEGLImageTargetTexture2DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glEGLImageTargetRenderbufferStorageOES", userData); set_glEGLImageTargetRenderbufferStorageOES((glEGLImageTargetRenderbufferStorageOES_client_proc_t)ptr);
|
||||
ptr = getProc("glAlphaFuncxOES", userData); set_glAlphaFuncxOES((glAlphaFuncxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glClearColorxOES", userData); set_glClearColorxOES((glClearColorxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glClearDepthxOES", userData); set_glClearDepthxOES((glClearDepthxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glClipPlanexOES", userData); set_glClipPlanexOES((glClipPlanexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glClipPlanexIMG", userData); set_glClipPlanexIMG((glClipPlanexIMG_client_proc_t)ptr);
|
||||
ptr = getProc("glColor4xOES", userData); set_glColor4xOES((glColor4xOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthRangexOES", userData); set_glDepthRangexOES((glDepthRangexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glFogxOES", userData); set_glFogxOES((glFogxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glFogxvOES", userData); set_glFogxvOES((glFogxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glFrustumxOES", userData); set_glFrustumxOES((glFrustumxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetClipPlanexOES", userData); set_glGetClipPlanexOES((glGetClipPlanexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetClipPlanex", userData); set_glGetClipPlanex((glGetClipPlanex_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFixedvOES", userData); set_glGetFixedvOES((glGetFixedvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetLightxvOES", userData); set_glGetLightxvOES((glGetLightxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetMaterialxvOES", userData); set_glGetMaterialxvOES((glGetMaterialxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexEnvxvOES", userData); set_glGetTexEnvxvOES((glGetTexEnvxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexParameterxvOES", userData); set_glGetTexParameterxvOES((glGetTexParameterxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glLightModelxOES", userData); set_glLightModelxOES((glLightModelxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glLightModelxvOES", userData); set_glLightModelxvOES((glLightModelxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glLightxOES", userData); set_glLightxOES((glLightxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glLightxvOES", userData); set_glLightxvOES((glLightxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glLineWidthxOES", userData); set_glLineWidthxOES((glLineWidthxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glLoadMatrixxOES", userData); set_glLoadMatrixxOES((glLoadMatrixxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glMaterialxOES", userData); set_glMaterialxOES((glMaterialxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glMaterialxvOES", userData); set_glMaterialxvOES((glMaterialxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glMultMatrixxOES", userData); set_glMultMatrixxOES((glMultMatrixxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiTexCoord4xOES", userData); set_glMultiTexCoord4xOES((glMultiTexCoord4xOES_client_proc_t)ptr);
|
||||
ptr = getProc("glNormal3xOES", userData); set_glNormal3xOES((glNormal3xOES_client_proc_t)ptr);
|
||||
ptr = getProc("glOrthoxOES", userData); set_glOrthoxOES((glOrthoxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glPointParameterxOES", userData); set_glPointParameterxOES((glPointParameterxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glPointParameterxvOES", userData); set_glPointParameterxvOES((glPointParameterxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glPointSizexOES", userData); set_glPointSizexOES((glPointSizexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glPolygonOffsetxOES", userData); set_glPolygonOffsetxOES((glPolygonOffsetxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glRotatexOES", userData); set_glRotatexOES((glRotatexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glSampleCoveragexOES", userData); set_glSampleCoveragexOES((glSampleCoveragexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glScalexOES", userData); set_glScalexOES((glScalexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnvxOES", userData); set_glTexEnvxOES((glTexEnvxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexEnvxvOES", userData); set_glTexEnvxvOES((glTexEnvxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterxOES", userData); set_glTexParameterxOES((glTexParameterxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterxvOES", userData); set_glTexParameterxvOES((glTexParameterxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTranslatexOES", userData); set_glTranslatexOES((glTranslatexOES_client_proc_t)ptr);
|
||||
ptr = getProc("glIsRenderbufferOES", userData); set_glIsRenderbufferOES((glIsRenderbufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glBindRenderbufferOES", userData); set_glBindRenderbufferOES((glBindRenderbufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteRenderbuffersOES", userData); set_glDeleteRenderbuffersOES((glDeleteRenderbuffersOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGenRenderbuffersOES", userData); set_glGenRenderbuffersOES((glGenRenderbuffersOES_client_proc_t)ptr);
|
||||
ptr = getProc("glRenderbufferStorageOES", userData); set_glRenderbufferStorageOES((glRenderbufferStorageOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetRenderbufferParameterivOES", userData); set_glGetRenderbufferParameterivOES((glGetRenderbufferParameterivOES_client_proc_t)ptr);
|
||||
ptr = getProc("glIsFramebufferOES", userData); set_glIsFramebufferOES((glIsFramebufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glBindFramebufferOES", userData); set_glBindFramebufferOES((glBindFramebufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteFramebuffersOES", userData); set_glDeleteFramebuffersOES((glDeleteFramebuffersOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGenFramebuffersOES", userData); set_glGenFramebuffersOES((glGenFramebuffersOES_client_proc_t)ptr);
|
||||
ptr = getProc("glCheckFramebufferStatusOES", userData); set_glCheckFramebufferStatusOES((glCheckFramebufferStatusOES_client_proc_t)ptr);
|
||||
ptr = getProc("glFramebufferRenderbufferOES", userData); set_glFramebufferRenderbufferOES((glFramebufferRenderbufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glFramebufferTexture2DOES", userData); set_glFramebufferTexture2DOES((glFramebufferTexture2DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFramebufferAttachmentParameterivOES", userData); set_glGetFramebufferAttachmentParameterivOES((glGetFramebufferAttachmentParameterivOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGenerateMipmapOES", userData); set_glGenerateMipmapOES((glGenerateMipmapOES_client_proc_t)ptr);
|
||||
ptr = getProc("glMapBufferOES", userData); set_glMapBufferOES((glMapBufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glUnmapBufferOES", userData); set_glUnmapBufferOES((glUnmapBufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetBufferPointervOES", userData); set_glGetBufferPointervOES((glGetBufferPointervOES_client_proc_t)ptr);
|
||||
ptr = getProc("glCurrentPaletteMatrixOES", userData); set_glCurrentPaletteMatrixOES((glCurrentPaletteMatrixOES_client_proc_t)ptr);
|
||||
ptr = getProc("glLoadPaletteFromModelViewMatrixOES", userData); set_glLoadPaletteFromModelViewMatrixOES((glLoadPaletteFromModelViewMatrixOES_client_proc_t)ptr);
|
||||
ptr = getProc("glMatrixIndexPointerOES", userData); set_glMatrixIndexPointerOES((glMatrixIndexPointerOES_client_proc_t)ptr);
|
||||
ptr = getProc("glWeightPointerOES", userData); set_glWeightPointerOES((glWeightPointerOES_client_proc_t)ptr);
|
||||
ptr = getProc("glQueryMatrixxOES", userData); set_glQueryMatrixxOES((glQueryMatrixxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthRangefOES", userData); set_glDepthRangefOES((glDepthRangefOES_client_proc_t)ptr);
|
||||
ptr = getProc("glFrustumfOES", userData); set_glFrustumfOES((glFrustumfOES_client_proc_t)ptr);
|
||||
ptr = getProc("glOrthofOES", userData); set_glOrthofOES((glOrthofOES_client_proc_t)ptr);
|
||||
ptr = getProc("glClipPlanefOES", userData); set_glClipPlanefOES((glClipPlanefOES_client_proc_t)ptr);
|
||||
ptr = getProc("glClipPlanefIMG", userData); set_glClipPlanefIMG((glClipPlanefIMG_client_proc_t)ptr);
|
||||
ptr = getProc("glGetClipPlanefOES", userData); set_glGetClipPlanefOES((glGetClipPlanefOES_client_proc_t)ptr);
|
||||
ptr = getProc("glClearDepthfOES", userData); set_glClearDepthfOES((glClearDepthfOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexGenfOES", userData); set_glTexGenfOES((glTexGenfOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexGenfvOES", userData); set_glTexGenfvOES((glTexGenfvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexGeniOES", userData); set_glTexGeniOES((glTexGeniOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexGenivOES", userData); set_glTexGenivOES((glTexGenivOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexGenxOES", userData); set_glTexGenxOES((glTexGenxOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexGenxvOES", userData); set_glTexGenxvOES((glTexGenxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexGenfvOES", userData); set_glGetTexGenfvOES((glGetTexGenfvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexGenivOES", userData); set_glGetTexGenivOES((glGetTexGenivOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexGenxvOES", userData); set_glGetTexGenxvOES((glGetTexGenxvOES_client_proc_t)ptr);
|
||||
ptr = getProc("glBindVertexArrayOES", userData); set_glBindVertexArrayOES((glBindVertexArrayOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteVertexArraysOES", userData); set_glDeleteVertexArraysOES((glDeleteVertexArraysOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGenVertexArraysOES", userData); set_glGenVertexArraysOES((glGenVertexArraysOES_client_proc_t)ptr);
|
||||
ptr = getProc("glIsVertexArrayOES", userData); set_glIsVertexArrayOES((glIsVertexArrayOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDiscardFramebufferEXT", userData); set_glDiscardFramebufferEXT((glDiscardFramebufferEXT_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiDrawArraysEXT", userData); set_glMultiDrawArraysEXT((glMultiDrawArraysEXT_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiDrawElementsEXT", userData); set_glMultiDrawElementsEXT((glMultiDrawElementsEXT_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiDrawArraysSUN", userData); set_glMultiDrawArraysSUN((glMultiDrawArraysSUN_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiDrawElementsSUN", userData); set_glMultiDrawElementsSUN((glMultiDrawElementsSUN_client_proc_t)ptr);
|
||||
ptr = getProc("glRenderbufferStorageMultisampleIMG", userData); set_glRenderbufferStorageMultisampleIMG((glRenderbufferStorageMultisampleIMG_client_proc_t)ptr);
|
||||
ptr = getProc("glFramebufferTexture2DMultisampleIMG", userData); set_glFramebufferTexture2DMultisampleIMG((glFramebufferTexture2DMultisampleIMG_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteFencesNV", userData); set_glDeleteFencesNV((glDeleteFencesNV_client_proc_t)ptr);
|
||||
ptr = getProc("glGenFencesNV", userData); set_glGenFencesNV((glGenFencesNV_client_proc_t)ptr);
|
||||
ptr = getProc("glIsFenceNV", userData); set_glIsFenceNV((glIsFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glTestFenceNV", userData); set_glTestFenceNV((glTestFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFenceivNV", userData); set_glGetFenceivNV((glGetFenceivNV_client_proc_t)ptr);
|
||||
ptr = getProc("glFinishFenceNV", userData); set_glFinishFenceNV((glFinishFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glSetFenceNV", userData); set_glSetFenceNV((glSetFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glGetDriverControlsQCOM", userData); set_glGetDriverControlsQCOM((glGetDriverControlsQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glGetDriverControlStringQCOM", userData); set_glGetDriverControlStringQCOM((glGetDriverControlStringQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glEnableDriverControlQCOM", userData); set_glEnableDriverControlQCOM((glEnableDriverControlQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glDisableDriverControlQCOM", userData); set_glDisableDriverControlQCOM((glDisableDriverControlQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetTexturesQCOM", userData); set_glExtGetTexturesQCOM((glExtGetTexturesQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetBuffersQCOM", userData); set_glExtGetBuffersQCOM((glExtGetBuffersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetRenderbuffersQCOM", userData); set_glExtGetRenderbuffersQCOM((glExtGetRenderbuffersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetFramebuffersQCOM", userData); set_glExtGetFramebuffersQCOM((glExtGetFramebuffersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetTexLevelParameterivQCOM", userData); set_glExtGetTexLevelParameterivQCOM((glExtGetTexLevelParameterivQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtTexObjectStateOverrideiQCOM", userData); set_glExtTexObjectStateOverrideiQCOM((glExtTexObjectStateOverrideiQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetTexSubImageQCOM", userData); set_glExtGetTexSubImageQCOM((glExtGetTexSubImageQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetBufferPointervQCOM", userData); set_glExtGetBufferPointervQCOM((glExtGetBufferPointervQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetShadersQCOM", userData); set_glExtGetShadersQCOM((glExtGetShadersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetProgramsQCOM", userData); set_glExtGetProgramsQCOM((glExtGetProgramsQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtIsProgramBinaryQCOM", userData); set_glExtIsProgramBinaryQCOM((glExtIsProgramBinaryQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetProgramBinarySourceQCOM", userData); set_glExtGetProgramBinarySourceQCOM((glExtGetProgramBinarySourceQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glStartTilingQCOM", userData); set_glStartTilingQCOM((glStartTilingQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glEndTilingQCOM", userData); set_glEndTilingQCOM((glEndTilingQCOM_client_proc_t)ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
603
tools/emulator/opengl/system/GLESv1_enc/gl_client_context.h
Normal file
603
tools/emulator/opengl/system/GLESv1_enc/gl_client_context.h
Normal file
@@ -0,0 +1,603 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __gl_client_context_t_h
|
||||
#define __gl_client_context_t_h
|
||||
|
||||
#include "gl_client_proc.h"
|
||||
|
||||
|
||||
struct gl_client_context_t {
|
||||
|
||||
glAlphaFunc_client_proc_t glAlphaFunc;
|
||||
glClearColor_client_proc_t glClearColor;
|
||||
glClearDepthf_client_proc_t glClearDepthf;
|
||||
glClipPlanef_client_proc_t glClipPlanef;
|
||||
glColor4f_client_proc_t glColor4f;
|
||||
glDepthRangef_client_proc_t glDepthRangef;
|
||||
glFogf_client_proc_t glFogf;
|
||||
glFogfv_client_proc_t glFogfv;
|
||||
glFrustumf_client_proc_t glFrustumf;
|
||||
glGetClipPlanef_client_proc_t glGetClipPlanef;
|
||||
glGetFloatv_client_proc_t glGetFloatv;
|
||||
glGetLightfv_client_proc_t glGetLightfv;
|
||||
glGetMaterialfv_client_proc_t glGetMaterialfv;
|
||||
glGetTexEnvfv_client_proc_t glGetTexEnvfv;
|
||||
glGetTexParameterfv_client_proc_t glGetTexParameterfv;
|
||||
glLightModelf_client_proc_t glLightModelf;
|
||||
glLightModelfv_client_proc_t glLightModelfv;
|
||||
glLightf_client_proc_t glLightf;
|
||||
glLightfv_client_proc_t glLightfv;
|
||||
glLineWidth_client_proc_t glLineWidth;
|
||||
glLoadMatrixf_client_proc_t glLoadMatrixf;
|
||||
glMaterialf_client_proc_t glMaterialf;
|
||||
glMaterialfv_client_proc_t glMaterialfv;
|
||||
glMultMatrixf_client_proc_t glMultMatrixf;
|
||||
glMultiTexCoord4f_client_proc_t glMultiTexCoord4f;
|
||||
glNormal3f_client_proc_t glNormal3f;
|
||||
glOrthof_client_proc_t glOrthof;
|
||||
glPointParameterf_client_proc_t glPointParameterf;
|
||||
glPointParameterfv_client_proc_t glPointParameterfv;
|
||||
glPointSize_client_proc_t glPointSize;
|
||||
glPolygonOffset_client_proc_t glPolygonOffset;
|
||||
glRotatef_client_proc_t glRotatef;
|
||||
glScalef_client_proc_t glScalef;
|
||||
glTexEnvf_client_proc_t glTexEnvf;
|
||||
glTexEnvfv_client_proc_t glTexEnvfv;
|
||||
glTexParameterf_client_proc_t glTexParameterf;
|
||||
glTexParameterfv_client_proc_t glTexParameterfv;
|
||||
glTranslatef_client_proc_t glTranslatef;
|
||||
glActiveTexture_client_proc_t glActiveTexture;
|
||||
glAlphaFuncx_client_proc_t glAlphaFuncx;
|
||||
glBindBuffer_client_proc_t glBindBuffer;
|
||||
glBindTexture_client_proc_t glBindTexture;
|
||||
glBlendFunc_client_proc_t glBlendFunc;
|
||||
glBufferData_client_proc_t glBufferData;
|
||||
glBufferSubData_client_proc_t glBufferSubData;
|
||||
glClear_client_proc_t glClear;
|
||||
glClearColorx_client_proc_t glClearColorx;
|
||||
glClearDepthx_client_proc_t glClearDepthx;
|
||||
glClearStencil_client_proc_t glClearStencil;
|
||||
glClientActiveTexture_client_proc_t glClientActiveTexture;
|
||||
glColor4ub_client_proc_t glColor4ub;
|
||||
glColor4x_client_proc_t glColor4x;
|
||||
glColorMask_client_proc_t glColorMask;
|
||||
glColorPointer_client_proc_t glColorPointer;
|
||||
glCompressedTexImage2D_client_proc_t glCompressedTexImage2D;
|
||||
glCompressedTexSubImage2D_client_proc_t glCompressedTexSubImage2D;
|
||||
glCopyTexImage2D_client_proc_t glCopyTexImage2D;
|
||||
glCopyTexSubImage2D_client_proc_t glCopyTexSubImage2D;
|
||||
glCullFace_client_proc_t glCullFace;
|
||||
glDeleteBuffers_client_proc_t glDeleteBuffers;
|
||||
glDeleteTextures_client_proc_t glDeleteTextures;
|
||||
glDepthFunc_client_proc_t glDepthFunc;
|
||||
glDepthMask_client_proc_t glDepthMask;
|
||||
glDepthRangex_client_proc_t glDepthRangex;
|
||||
glDisable_client_proc_t glDisable;
|
||||
glDisableClientState_client_proc_t glDisableClientState;
|
||||
glDrawArrays_client_proc_t glDrawArrays;
|
||||
glDrawElements_client_proc_t glDrawElements;
|
||||
glEnable_client_proc_t glEnable;
|
||||
glEnableClientState_client_proc_t glEnableClientState;
|
||||
glFinish_client_proc_t glFinish;
|
||||
glFlush_client_proc_t glFlush;
|
||||
glFogx_client_proc_t glFogx;
|
||||
glFogxv_client_proc_t glFogxv;
|
||||
glFrontFace_client_proc_t glFrontFace;
|
||||
glFrustumx_client_proc_t glFrustumx;
|
||||
glGetBooleanv_client_proc_t glGetBooleanv;
|
||||
glGetBufferParameteriv_client_proc_t glGetBufferParameteriv;
|
||||
glClipPlanex_client_proc_t glClipPlanex;
|
||||
glGenBuffers_client_proc_t glGenBuffers;
|
||||
glGenTextures_client_proc_t glGenTextures;
|
||||
glGetError_client_proc_t glGetError;
|
||||
glGetFixedv_client_proc_t glGetFixedv;
|
||||
glGetIntegerv_client_proc_t glGetIntegerv;
|
||||
glGetLightxv_client_proc_t glGetLightxv;
|
||||
glGetMaterialxv_client_proc_t glGetMaterialxv;
|
||||
glGetPointerv_client_proc_t glGetPointerv;
|
||||
glGetString_client_proc_t glGetString;
|
||||
glGetTexEnviv_client_proc_t glGetTexEnviv;
|
||||
glGetTexEnvxv_client_proc_t glGetTexEnvxv;
|
||||
glGetTexParameteriv_client_proc_t glGetTexParameteriv;
|
||||
glGetTexParameterxv_client_proc_t glGetTexParameterxv;
|
||||
glHint_client_proc_t glHint;
|
||||
glIsBuffer_client_proc_t glIsBuffer;
|
||||
glIsEnabled_client_proc_t glIsEnabled;
|
||||
glIsTexture_client_proc_t glIsTexture;
|
||||
glLightModelx_client_proc_t glLightModelx;
|
||||
glLightModelxv_client_proc_t glLightModelxv;
|
||||
glLightx_client_proc_t glLightx;
|
||||
glLightxv_client_proc_t glLightxv;
|
||||
glLineWidthx_client_proc_t glLineWidthx;
|
||||
glLoadIdentity_client_proc_t glLoadIdentity;
|
||||
glLoadMatrixx_client_proc_t glLoadMatrixx;
|
||||
glLogicOp_client_proc_t glLogicOp;
|
||||
glMaterialx_client_proc_t glMaterialx;
|
||||
glMaterialxv_client_proc_t glMaterialxv;
|
||||
glMatrixMode_client_proc_t glMatrixMode;
|
||||
glMultMatrixx_client_proc_t glMultMatrixx;
|
||||
glMultiTexCoord4x_client_proc_t glMultiTexCoord4x;
|
||||
glNormal3x_client_proc_t glNormal3x;
|
||||
glNormalPointer_client_proc_t glNormalPointer;
|
||||
glOrthox_client_proc_t glOrthox;
|
||||
glPixelStorei_client_proc_t glPixelStorei;
|
||||
glPointParameterx_client_proc_t glPointParameterx;
|
||||
glPointParameterxv_client_proc_t glPointParameterxv;
|
||||
glPointSizex_client_proc_t glPointSizex;
|
||||
glPolygonOffsetx_client_proc_t glPolygonOffsetx;
|
||||
glPopMatrix_client_proc_t glPopMatrix;
|
||||
glPushMatrix_client_proc_t glPushMatrix;
|
||||
glReadPixels_client_proc_t glReadPixels;
|
||||
glRotatex_client_proc_t glRotatex;
|
||||
glSampleCoverage_client_proc_t glSampleCoverage;
|
||||
glSampleCoveragex_client_proc_t glSampleCoveragex;
|
||||
glScalex_client_proc_t glScalex;
|
||||
glScissor_client_proc_t glScissor;
|
||||
glShadeModel_client_proc_t glShadeModel;
|
||||
glStencilFunc_client_proc_t glStencilFunc;
|
||||
glStencilMask_client_proc_t glStencilMask;
|
||||
glStencilOp_client_proc_t glStencilOp;
|
||||
glTexCoordPointer_client_proc_t glTexCoordPointer;
|
||||
glTexEnvi_client_proc_t glTexEnvi;
|
||||
glTexEnvx_client_proc_t glTexEnvx;
|
||||
glTexEnviv_client_proc_t glTexEnviv;
|
||||
glTexEnvxv_client_proc_t glTexEnvxv;
|
||||
glTexImage2D_client_proc_t glTexImage2D;
|
||||
glTexParameteri_client_proc_t glTexParameteri;
|
||||
glTexParameterx_client_proc_t glTexParameterx;
|
||||
glTexParameteriv_client_proc_t glTexParameteriv;
|
||||
glTexParameterxv_client_proc_t glTexParameterxv;
|
||||
glTexSubImage2D_client_proc_t glTexSubImage2D;
|
||||
glTranslatex_client_proc_t glTranslatex;
|
||||
glVertexPointer_client_proc_t glVertexPointer;
|
||||
glViewport_client_proc_t glViewport;
|
||||
glPointSizePointerOES_client_proc_t glPointSizePointerOES;
|
||||
glVertexPointerOffset_client_proc_t glVertexPointerOffset;
|
||||
glColorPointerOffset_client_proc_t glColorPointerOffset;
|
||||
glNormalPointerOffset_client_proc_t glNormalPointerOffset;
|
||||
glPointSizePointerOffset_client_proc_t glPointSizePointerOffset;
|
||||
glTexCoordPointerOffset_client_proc_t glTexCoordPointerOffset;
|
||||
glWeightPointerOffset_client_proc_t glWeightPointerOffset;
|
||||
glMatrixIndexPointerOffset_client_proc_t glMatrixIndexPointerOffset;
|
||||
glVertexPointerData_client_proc_t glVertexPointerData;
|
||||
glColorPointerData_client_proc_t glColorPointerData;
|
||||
glNormalPointerData_client_proc_t glNormalPointerData;
|
||||
glTexCoordPointerData_client_proc_t glTexCoordPointerData;
|
||||
glPointSizePointerData_client_proc_t glPointSizePointerData;
|
||||
glWeightPointerData_client_proc_t glWeightPointerData;
|
||||
glMatrixIndexPointerData_client_proc_t glMatrixIndexPointerData;
|
||||
glDrawElementsOffset_client_proc_t glDrawElementsOffset;
|
||||
glDrawElementsData_client_proc_t glDrawElementsData;
|
||||
glGetCompressedTextureFormats_client_proc_t glGetCompressedTextureFormats;
|
||||
glFinishRoundTrip_client_proc_t glFinishRoundTrip;
|
||||
glBlendEquationSeparateOES_client_proc_t glBlendEquationSeparateOES;
|
||||
glBlendFuncSeparateOES_client_proc_t glBlendFuncSeparateOES;
|
||||
glBlendEquationOES_client_proc_t glBlendEquationOES;
|
||||
glDrawTexsOES_client_proc_t glDrawTexsOES;
|
||||
glDrawTexiOES_client_proc_t glDrawTexiOES;
|
||||
glDrawTexxOES_client_proc_t glDrawTexxOES;
|
||||
glDrawTexsvOES_client_proc_t glDrawTexsvOES;
|
||||
glDrawTexivOES_client_proc_t glDrawTexivOES;
|
||||
glDrawTexxvOES_client_proc_t glDrawTexxvOES;
|
||||
glDrawTexfOES_client_proc_t glDrawTexfOES;
|
||||
glDrawTexfvOES_client_proc_t glDrawTexfvOES;
|
||||
glEGLImageTargetTexture2DOES_client_proc_t glEGLImageTargetTexture2DOES;
|
||||
glEGLImageTargetRenderbufferStorageOES_client_proc_t glEGLImageTargetRenderbufferStorageOES;
|
||||
glAlphaFuncxOES_client_proc_t glAlphaFuncxOES;
|
||||
glClearColorxOES_client_proc_t glClearColorxOES;
|
||||
glClearDepthxOES_client_proc_t glClearDepthxOES;
|
||||
glClipPlanexOES_client_proc_t glClipPlanexOES;
|
||||
glClipPlanexIMG_client_proc_t glClipPlanexIMG;
|
||||
glColor4xOES_client_proc_t glColor4xOES;
|
||||
glDepthRangexOES_client_proc_t glDepthRangexOES;
|
||||
glFogxOES_client_proc_t glFogxOES;
|
||||
glFogxvOES_client_proc_t glFogxvOES;
|
||||
glFrustumxOES_client_proc_t glFrustumxOES;
|
||||
glGetClipPlanexOES_client_proc_t glGetClipPlanexOES;
|
||||
glGetClipPlanex_client_proc_t glGetClipPlanex;
|
||||
glGetFixedvOES_client_proc_t glGetFixedvOES;
|
||||
glGetLightxvOES_client_proc_t glGetLightxvOES;
|
||||
glGetMaterialxvOES_client_proc_t glGetMaterialxvOES;
|
||||
glGetTexEnvxvOES_client_proc_t glGetTexEnvxvOES;
|
||||
glGetTexParameterxvOES_client_proc_t glGetTexParameterxvOES;
|
||||
glLightModelxOES_client_proc_t glLightModelxOES;
|
||||
glLightModelxvOES_client_proc_t glLightModelxvOES;
|
||||
glLightxOES_client_proc_t glLightxOES;
|
||||
glLightxvOES_client_proc_t glLightxvOES;
|
||||
glLineWidthxOES_client_proc_t glLineWidthxOES;
|
||||
glLoadMatrixxOES_client_proc_t glLoadMatrixxOES;
|
||||
glMaterialxOES_client_proc_t glMaterialxOES;
|
||||
glMaterialxvOES_client_proc_t glMaterialxvOES;
|
||||
glMultMatrixxOES_client_proc_t glMultMatrixxOES;
|
||||
glMultiTexCoord4xOES_client_proc_t glMultiTexCoord4xOES;
|
||||
glNormal3xOES_client_proc_t glNormal3xOES;
|
||||
glOrthoxOES_client_proc_t glOrthoxOES;
|
||||
glPointParameterxOES_client_proc_t glPointParameterxOES;
|
||||
glPointParameterxvOES_client_proc_t glPointParameterxvOES;
|
||||
glPointSizexOES_client_proc_t glPointSizexOES;
|
||||
glPolygonOffsetxOES_client_proc_t glPolygonOffsetxOES;
|
||||
glRotatexOES_client_proc_t glRotatexOES;
|
||||
glSampleCoveragexOES_client_proc_t glSampleCoveragexOES;
|
||||
glScalexOES_client_proc_t glScalexOES;
|
||||
glTexEnvxOES_client_proc_t glTexEnvxOES;
|
||||
glTexEnvxvOES_client_proc_t glTexEnvxvOES;
|
||||
glTexParameterxOES_client_proc_t glTexParameterxOES;
|
||||
glTexParameterxvOES_client_proc_t glTexParameterxvOES;
|
||||
glTranslatexOES_client_proc_t glTranslatexOES;
|
||||
glIsRenderbufferOES_client_proc_t glIsRenderbufferOES;
|
||||
glBindRenderbufferOES_client_proc_t glBindRenderbufferOES;
|
||||
glDeleteRenderbuffersOES_client_proc_t glDeleteRenderbuffersOES;
|
||||
glGenRenderbuffersOES_client_proc_t glGenRenderbuffersOES;
|
||||
glRenderbufferStorageOES_client_proc_t glRenderbufferStorageOES;
|
||||
glGetRenderbufferParameterivOES_client_proc_t glGetRenderbufferParameterivOES;
|
||||
glIsFramebufferOES_client_proc_t glIsFramebufferOES;
|
||||
glBindFramebufferOES_client_proc_t glBindFramebufferOES;
|
||||
glDeleteFramebuffersOES_client_proc_t glDeleteFramebuffersOES;
|
||||
glGenFramebuffersOES_client_proc_t glGenFramebuffersOES;
|
||||
glCheckFramebufferStatusOES_client_proc_t glCheckFramebufferStatusOES;
|
||||
glFramebufferRenderbufferOES_client_proc_t glFramebufferRenderbufferOES;
|
||||
glFramebufferTexture2DOES_client_proc_t glFramebufferTexture2DOES;
|
||||
glGetFramebufferAttachmentParameterivOES_client_proc_t glGetFramebufferAttachmentParameterivOES;
|
||||
glGenerateMipmapOES_client_proc_t glGenerateMipmapOES;
|
||||
glMapBufferOES_client_proc_t glMapBufferOES;
|
||||
glUnmapBufferOES_client_proc_t glUnmapBufferOES;
|
||||
glGetBufferPointervOES_client_proc_t glGetBufferPointervOES;
|
||||
glCurrentPaletteMatrixOES_client_proc_t glCurrentPaletteMatrixOES;
|
||||
glLoadPaletteFromModelViewMatrixOES_client_proc_t glLoadPaletteFromModelViewMatrixOES;
|
||||
glMatrixIndexPointerOES_client_proc_t glMatrixIndexPointerOES;
|
||||
glWeightPointerOES_client_proc_t glWeightPointerOES;
|
||||
glQueryMatrixxOES_client_proc_t glQueryMatrixxOES;
|
||||
glDepthRangefOES_client_proc_t glDepthRangefOES;
|
||||
glFrustumfOES_client_proc_t glFrustumfOES;
|
||||
glOrthofOES_client_proc_t glOrthofOES;
|
||||
glClipPlanefOES_client_proc_t glClipPlanefOES;
|
||||
glClipPlanefIMG_client_proc_t glClipPlanefIMG;
|
||||
glGetClipPlanefOES_client_proc_t glGetClipPlanefOES;
|
||||
glClearDepthfOES_client_proc_t glClearDepthfOES;
|
||||
glTexGenfOES_client_proc_t glTexGenfOES;
|
||||
glTexGenfvOES_client_proc_t glTexGenfvOES;
|
||||
glTexGeniOES_client_proc_t glTexGeniOES;
|
||||
glTexGenivOES_client_proc_t glTexGenivOES;
|
||||
glTexGenxOES_client_proc_t glTexGenxOES;
|
||||
glTexGenxvOES_client_proc_t glTexGenxvOES;
|
||||
glGetTexGenfvOES_client_proc_t glGetTexGenfvOES;
|
||||
glGetTexGenivOES_client_proc_t glGetTexGenivOES;
|
||||
glGetTexGenxvOES_client_proc_t glGetTexGenxvOES;
|
||||
glBindVertexArrayOES_client_proc_t glBindVertexArrayOES;
|
||||
glDeleteVertexArraysOES_client_proc_t glDeleteVertexArraysOES;
|
||||
glGenVertexArraysOES_client_proc_t glGenVertexArraysOES;
|
||||
glIsVertexArrayOES_client_proc_t glIsVertexArrayOES;
|
||||
glDiscardFramebufferEXT_client_proc_t glDiscardFramebufferEXT;
|
||||
glMultiDrawArraysEXT_client_proc_t glMultiDrawArraysEXT;
|
||||
glMultiDrawElementsEXT_client_proc_t glMultiDrawElementsEXT;
|
||||
glMultiDrawArraysSUN_client_proc_t glMultiDrawArraysSUN;
|
||||
glMultiDrawElementsSUN_client_proc_t glMultiDrawElementsSUN;
|
||||
glRenderbufferStorageMultisampleIMG_client_proc_t glRenderbufferStorageMultisampleIMG;
|
||||
glFramebufferTexture2DMultisampleIMG_client_proc_t glFramebufferTexture2DMultisampleIMG;
|
||||
glDeleteFencesNV_client_proc_t glDeleteFencesNV;
|
||||
glGenFencesNV_client_proc_t glGenFencesNV;
|
||||
glIsFenceNV_client_proc_t glIsFenceNV;
|
||||
glTestFenceNV_client_proc_t glTestFenceNV;
|
||||
glGetFenceivNV_client_proc_t glGetFenceivNV;
|
||||
glFinishFenceNV_client_proc_t glFinishFenceNV;
|
||||
glSetFenceNV_client_proc_t glSetFenceNV;
|
||||
glGetDriverControlsQCOM_client_proc_t glGetDriverControlsQCOM;
|
||||
glGetDriverControlStringQCOM_client_proc_t glGetDriverControlStringQCOM;
|
||||
glEnableDriverControlQCOM_client_proc_t glEnableDriverControlQCOM;
|
||||
glDisableDriverControlQCOM_client_proc_t glDisableDriverControlQCOM;
|
||||
glExtGetTexturesQCOM_client_proc_t glExtGetTexturesQCOM;
|
||||
glExtGetBuffersQCOM_client_proc_t glExtGetBuffersQCOM;
|
||||
glExtGetRenderbuffersQCOM_client_proc_t glExtGetRenderbuffersQCOM;
|
||||
glExtGetFramebuffersQCOM_client_proc_t glExtGetFramebuffersQCOM;
|
||||
glExtGetTexLevelParameterivQCOM_client_proc_t glExtGetTexLevelParameterivQCOM;
|
||||
glExtTexObjectStateOverrideiQCOM_client_proc_t glExtTexObjectStateOverrideiQCOM;
|
||||
glExtGetTexSubImageQCOM_client_proc_t glExtGetTexSubImageQCOM;
|
||||
glExtGetBufferPointervQCOM_client_proc_t glExtGetBufferPointervQCOM;
|
||||
glExtGetShadersQCOM_client_proc_t glExtGetShadersQCOM;
|
||||
glExtGetProgramsQCOM_client_proc_t glExtGetProgramsQCOM;
|
||||
glExtIsProgramBinaryQCOM_client_proc_t glExtIsProgramBinaryQCOM;
|
||||
glExtGetProgramBinarySourceQCOM_client_proc_t glExtGetProgramBinarySourceQCOM;
|
||||
glStartTilingQCOM_client_proc_t glStartTilingQCOM;
|
||||
glEndTilingQCOM_client_proc_t glEndTilingQCOM;
|
||||
//Accessors
|
||||
virtual glAlphaFunc_client_proc_t set_glAlphaFunc(glAlphaFunc_client_proc_t f) { glAlphaFunc_client_proc_t retval = glAlphaFunc; glAlphaFunc = f; return retval;}
|
||||
virtual glClearColor_client_proc_t set_glClearColor(glClearColor_client_proc_t f) { glClearColor_client_proc_t retval = glClearColor; glClearColor = f; return retval;}
|
||||
virtual glClearDepthf_client_proc_t set_glClearDepthf(glClearDepthf_client_proc_t f) { glClearDepthf_client_proc_t retval = glClearDepthf; glClearDepthf = f; return retval;}
|
||||
virtual glClipPlanef_client_proc_t set_glClipPlanef(glClipPlanef_client_proc_t f) { glClipPlanef_client_proc_t retval = glClipPlanef; glClipPlanef = f; return retval;}
|
||||
virtual glColor4f_client_proc_t set_glColor4f(glColor4f_client_proc_t f) { glColor4f_client_proc_t retval = glColor4f; glColor4f = f; return retval;}
|
||||
virtual glDepthRangef_client_proc_t set_glDepthRangef(glDepthRangef_client_proc_t f) { glDepthRangef_client_proc_t retval = glDepthRangef; glDepthRangef = f; return retval;}
|
||||
virtual glFogf_client_proc_t set_glFogf(glFogf_client_proc_t f) { glFogf_client_proc_t retval = glFogf; glFogf = f; return retval;}
|
||||
virtual glFogfv_client_proc_t set_glFogfv(glFogfv_client_proc_t f) { glFogfv_client_proc_t retval = glFogfv; glFogfv = f; return retval;}
|
||||
virtual glFrustumf_client_proc_t set_glFrustumf(glFrustumf_client_proc_t f) { glFrustumf_client_proc_t retval = glFrustumf; glFrustumf = f; return retval;}
|
||||
virtual glGetClipPlanef_client_proc_t set_glGetClipPlanef(glGetClipPlanef_client_proc_t f) { glGetClipPlanef_client_proc_t retval = glGetClipPlanef; glGetClipPlanef = f; return retval;}
|
||||
virtual glGetFloatv_client_proc_t set_glGetFloatv(glGetFloatv_client_proc_t f) { glGetFloatv_client_proc_t retval = glGetFloatv; glGetFloatv = f; return retval;}
|
||||
virtual glGetLightfv_client_proc_t set_glGetLightfv(glGetLightfv_client_proc_t f) { glGetLightfv_client_proc_t retval = glGetLightfv; glGetLightfv = f; return retval;}
|
||||
virtual glGetMaterialfv_client_proc_t set_glGetMaterialfv(glGetMaterialfv_client_proc_t f) { glGetMaterialfv_client_proc_t retval = glGetMaterialfv; glGetMaterialfv = f; return retval;}
|
||||
virtual glGetTexEnvfv_client_proc_t set_glGetTexEnvfv(glGetTexEnvfv_client_proc_t f) { glGetTexEnvfv_client_proc_t retval = glGetTexEnvfv; glGetTexEnvfv = f; return retval;}
|
||||
virtual glGetTexParameterfv_client_proc_t set_glGetTexParameterfv(glGetTexParameterfv_client_proc_t f) { glGetTexParameterfv_client_proc_t retval = glGetTexParameterfv; glGetTexParameterfv = f; return retval;}
|
||||
virtual glLightModelf_client_proc_t set_glLightModelf(glLightModelf_client_proc_t f) { glLightModelf_client_proc_t retval = glLightModelf; glLightModelf = f; return retval;}
|
||||
virtual glLightModelfv_client_proc_t set_glLightModelfv(glLightModelfv_client_proc_t f) { glLightModelfv_client_proc_t retval = glLightModelfv; glLightModelfv = f; return retval;}
|
||||
virtual glLightf_client_proc_t set_glLightf(glLightf_client_proc_t f) { glLightf_client_proc_t retval = glLightf; glLightf = f; return retval;}
|
||||
virtual glLightfv_client_proc_t set_glLightfv(glLightfv_client_proc_t f) { glLightfv_client_proc_t retval = glLightfv; glLightfv = f; return retval;}
|
||||
virtual glLineWidth_client_proc_t set_glLineWidth(glLineWidth_client_proc_t f) { glLineWidth_client_proc_t retval = glLineWidth; glLineWidth = f; return retval;}
|
||||
virtual glLoadMatrixf_client_proc_t set_glLoadMatrixf(glLoadMatrixf_client_proc_t f) { glLoadMatrixf_client_proc_t retval = glLoadMatrixf; glLoadMatrixf = f; return retval;}
|
||||
virtual glMaterialf_client_proc_t set_glMaterialf(glMaterialf_client_proc_t f) { glMaterialf_client_proc_t retval = glMaterialf; glMaterialf = f; return retval;}
|
||||
virtual glMaterialfv_client_proc_t set_glMaterialfv(glMaterialfv_client_proc_t f) { glMaterialfv_client_proc_t retval = glMaterialfv; glMaterialfv = f; return retval;}
|
||||
virtual glMultMatrixf_client_proc_t set_glMultMatrixf(glMultMatrixf_client_proc_t f) { glMultMatrixf_client_proc_t retval = glMultMatrixf; glMultMatrixf = f; return retval;}
|
||||
virtual glMultiTexCoord4f_client_proc_t set_glMultiTexCoord4f(glMultiTexCoord4f_client_proc_t f) { glMultiTexCoord4f_client_proc_t retval = glMultiTexCoord4f; glMultiTexCoord4f = f; return retval;}
|
||||
virtual glNormal3f_client_proc_t set_glNormal3f(glNormal3f_client_proc_t f) { glNormal3f_client_proc_t retval = glNormal3f; glNormal3f = f; return retval;}
|
||||
virtual glOrthof_client_proc_t set_glOrthof(glOrthof_client_proc_t f) { glOrthof_client_proc_t retval = glOrthof; glOrthof = f; return retval;}
|
||||
virtual glPointParameterf_client_proc_t set_glPointParameterf(glPointParameterf_client_proc_t f) { glPointParameterf_client_proc_t retval = glPointParameterf; glPointParameterf = f; return retval;}
|
||||
virtual glPointParameterfv_client_proc_t set_glPointParameterfv(glPointParameterfv_client_proc_t f) { glPointParameterfv_client_proc_t retval = glPointParameterfv; glPointParameterfv = f; return retval;}
|
||||
virtual glPointSize_client_proc_t set_glPointSize(glPointSize_client_proc_t f) { glPointSize_client_proc_t retval = glPointSize; glPointSize = f; return retval;}
|
||||
virtual glPolygonOffset_client_proc_t set_glPolygonOffset(glPolygonOffset_client_proc_t f) { glPolygonOffset_client_proc_t retval = glPolygonOffset; glPolygonOffset = f; return retval;}
|
||||
virtual glRotatef_client_proc_t set_glRotatef(glRotatef_client_proc_t f) { glRotatef_client_proc_t retval = glRotatef; glRotatef = f; return retval;}
|
||||
virtual glScalef_client_proc_t set_glScalef(glScalef_client_proc_t f) { glScalef_client_proc_t retval = glScalef; glScalef = f; return retval;}
|
||||
virtual glTexEnvf_client_proc_t set_glTexEnvf(glTexEnvf_client_proc_t f) { glTexEnvf_client_proc_t retval = glTexEnvf; glTexEnvf = f; return retval;}
|
||||
virtual glTexEnvfv_client_proc_t set_glTexEnvfv(glTexEnvfv_client_proc_t f) { glTexEnvfv_client_proc_t retval = glTexEnvfv; glTexEnvfv = f; return retval;}
|
||||
virtual glTexParameterf_client_proc_t set_glTexParameterf(glTexParameterf_client_proc_t f) { glTexParameterf_client_proc_t retval = glTexParameterf; glTexParameterf = f; return retval;}
|
||||
virtual glTexParameterfv_client_proc_t set_glTexParameterfv(glTexParameterfv_client_proc_t f) { glTexParameterfv_client_proc_t retval = glTexParameterfv; glTexParameterfv = f; return retval;}
|
||||
virtual glTranslatef_client_proc_t set_glTranslatef(glTranslatef_client_proc_t f) { glTranslatef_client_proc_t retval = glTranslatef; glTranslatef = f; return retval;}
|
||||
virtual glActiveTexture_client_proc_t set_glActiveTexture(glActiveTexture_client_proc_t f) { glActiveTexture_client_proc_t retval = glActiveTexture; glActiveTexture = f; return retval;}
|
||||
virtual glAlphaFuncx_client_proc_t set_glAlphaFuncx(glAlphaFuncx_client_proc_t f) { glAlphaFuncx_client_proc_t retval = glAlphaFuncx; glAlphaFuncx = f; return retval;}
|
||||
virtual glBindBuffer_client_proc_t set_glBindBuffer(glBindBuffer_client_proc_t f) { glBindBuffer_client_proc_t retval = glBindBuffer; glBindBuffer = f; return retval;}
|
||||
virtual glBindTexture_client_proc_t set_glBindTexture(glBindTexture_client_proc_t f) { glBindTexture_client_proc_t retval = glBindTexture; glBindTexture = f; return retval;}
|
||||
virtual glBlendFunc_client_proc_t set_glBlendFunc(glBlendFunc_client_proc_t f) { glBlendFunc_client_proc_t retval = glBlendFunc; glBlendFunc = f; return retval;}
|
||||
virtual glBufferData_client_proc_t set_glBufferData(glBufferData_client_proc_t f) { glBufferData_client_proc_t retval = glBufferData; glBufferData = f; return retval;}
|
||||
virtual glBufferSubData_client_proc_t set_glBufferSubData(glBufferSubData_client_proc_t f) { glBufferSubData_client_proc_t retval = glBufferSubData; glBufferSubData = f; return retval;}
|
||||
virtual glClear_client_proc_t set_glClear(glClear_client_proc_t f) { glClear_client_proc_t retval = glClear; glClear = f; return retval;}
|
||||
virtual glClearColorx_client_proc_t set_glClearColorx(glClearColorx_client_proc_t f) { glClearColorx_client_proc_t retval = glClearColorx; glClearColorx = f; return retval;}
|
||||
virtual glClearDepthx_client_proc_t set_glClearDepthx(glClearDepthx_client_proc_t f) { glClearDepthx_client_proc_t retval = glClearDepthx; glClearDepthx = f; return retval;}
|
||||
virtual glClearStencil_client_proc_t set_glClearStencil(glClearStencil_client_proc_t f) { glClearStencil_client_proc_t retval = glClearStencil; glClearStencil = f; return retval;}
|
||||
virtual glClientActiveTexture_client_proc_t set_glClientActiveTexture(glClientActiveTexture_client_proc_t f) { glClientActiveTexture_client_proc_t retval = glClientActiveTexture; glClientActiveTexture = f; return retval;}
|
||||
virtual glColor4ub_client_proc_t set_glColor4ub(glColor4ub_client_proc_t f) { glColor4ub_client_proc_t retval = glColor4ub; glColor4ub = f; return retval;}
|
||||
virtual glColor4x_client_proc_t set_glColor4x(glColor4x_client_proc_t f) { glColor4x_client_proc_t retval = glColor4x; glColor4x = f; return retval;}
|
||||
virtual glColorMask_client_proc_t set_glColorMask(glColorMask_client_proc_t f) { glColorMask_client_proc_t retval = glColorMask; glColorMask = f; return retval;}
|
||||
virtual glColorPointer_client_proc_t set_glColorPointer(glColorPointer_client_proc_t f) { glColorPointer_client_proc_t retval = glColorPointer; glColorPointer = f; return retval;}
|
||||
virtual glCompressedTexImage2D_client_proc_t set_glCompressedTexImage2D(glCompressedTexImage2D_client_proc_t f) { glCompressedTexImage2D_client_proc_t retval = glCompressedTexImage2D; glCompressedTexImage2D = f; return retval;}
|
||||
virtual glCompressedTexSubImage2D_client_proc_t set_glCompressedTexSubImage2D(glCompressedTexSubImage2D_client_proc_t f) { glCompressedTexSubImage2D_client_proc_t retval = glCompressedTexSubImage2D; glCompressedTexSubImage2D = f; return retval;}
|
||||
virtual glCopyTexImage2D_client_proc_t set_glCopyTexImage2D(glCopyTexImage2D_client_proc_t f) { glCopyTexImage2D_client_proc_t retval = glCopyTexImage2D; glCopyTexImage2D = f; return retval;}
|
||||
virtual glCopyTexSubImage2D_client_proc_t set_glCopyTexSubImage2D(glCopyTexSubImage2D_client_proc_t f) { glCopyTexSubImage2D_client_proc_t retval = glCopyTexSubImage2D; glCopyTexSubImage2D = f; return retval;}
|
||||
virtual glCullFace_client_proc_t set_glCullFace(glCullFace_client_proc_t f) { glCullFace_client_proc_t retval = glCullFace; glCullFace = f; return retval;}
|
||||
virtual glDeleteBuffers_client_proc_t set_glDeleteBuffers(glDeleteBuffers_client_proc_t f) { glDeleteBuffers_client_proc_t retval = glDeleteBuffers; glDeleteBuffers = f; return retval;}
|
||||
virtual glDeleteTextures_client_proc_t set_glDeleteTextures(glDeleteTextures_client_proc_t f) { glDeleteTextures_client_proc_t retval = glDeleteTextures; glDeleteTextures = f; return retval;}
|
||||
virtual glDepthFunc_client_proc_t set_glDepthFunc(glDepthFunc_client_proc_t f) { glDepthFunc_client_proc_t retval = glDepthFunc; glDepthFunc = f; return retval;}
|
||||
virtual glDepthMask_client_proc_t set_glDepthMask(glDepthMask_client_proc_t f) { glDepthMask_client_proc_t retval = glDepthMask; glDepthMask = f; return retval;}
|
||||
virtual glDepthRangex_client_proc_t set_glDepthRangex(glDepthRangex_client_proc_t f) { glDepthRangex_client_proc_t retval = glDepthRangex; glDepthRangex = f; return retval;}
|
||||
virtual glDisable_client_proc_t set_glDisable(glDisable_client_proc_t f) { glDisable_client_proc_t retval = glDisable; glDisable = f; return retval;}
|
||||
virtual glDisableClientState_client_proc_t set_glDisableClientState(glDisableClientState_client_proc_t f) { glDisableClientState_client_proc_t retval = glDisableClientState; glDisableClientState = f; return retval;}
|
||||
virtual glDrawArrays_client_proc_t set_glDrawArrays(glDrawArrays_client_proc_t f) { glDrawArrays_client_proc_t retval = glDrawArrays; glDrawArrays = f; return retval;}
|
||||
virtual glDrawElements_client_proc_t set_glDrawElements(glDrawElements_client_proc_t f) { glDrawElements_client_proc_t retval = glDrawElements; glDrawElements = f; return retval;}
|
||||
virtual glEnable_client_proc_t set_glEnable(glEnable_client_proc_t f) { glEnable_client_proc_t retval = glEnable; glEnable = f; return retval;}
|
||||
virtual glEnableClientState_client_proc_t set_glEnableClientState(glEnableClientState_client_proc_t f) { glEnableClientState_client_proc_t retval = glEnableClientState; glEnableClientState = f; return retval;}
|
||||
virtual glFinish_client_proc_t set_glFinish(glFinish_client_proc_t f) { glFinish_client_proc_t retval = glFinish; glFinish = f; return retval;}
|
||||
virtual glFlush_client_proc_t set_glFlush(glFlush_client_proc_t f) { glFlush_client_proc_t retval = glFlush; glFlush = f; return retval;}
|
||||
virtual glFogx_client_proc_t set_glFogx(glFogx_client_proc_t f) { glFogx_client_proc_t retval = glFogx; glFogx = f; return retval;}
|
||||
virtual glFogxv_client_proc_t set_glFogxv(glFogxv_client_proc_t f) { glFogxv_client_proc_t retval = glFogxv; glFogxv = f; return retval;}
|
||||
virtual glFrontFace_client_proc_t set_glFrontFace(glFrontFace_client_proc_t f) { glFrontFace_client_proc_t retval = glFrontFace; glFrontFace = f; return retval;}
|
||||
virtual glFrustumx_client_proc_t set_glFrustumx(glFrustumx_client_proc_t f) { glFrustumx_client_proc_t retval = glFrustumx; glFrustumx = f; return retval;}
|
||||
virtual glGetBooleanv_client_proc_t set_glGetBooleanv(glGetBooleanv_client_proc_t f) { glGetBooleanv_client_proc_t retval = glGetBooleanv; glGetBooleanv = f; return retval;}
|
||||
virtual glGetBufferParameteriv_client_proc_t set_glGetBufferParameteriv(glGetBufferParameteriv_client_proc_t f) { glGetBufferParameteriv_client_proc_t retval = glGetBufferParameteriv; glGetBufferParameteriv = f; return retval;}
|
||||
virtual glClipPlanex_client_proc_t set_glClipPlanex(glClipPlanex_client_proc_t f) { glClipPlanex_client_proc_t retval = glClipPlanex; glClipPlanex = f; return retval;}
|
||||
virtual glGenBuffers_client_proc_t set_glGenBuffers(glGenBuffers_client_proc_t f) { glGenBuffers_client_proc_t retval = glGenBuffers; glGenBuffers = f; return retval;}
|
||||
virtual glGenTextures_client_proc_t set_glGenTextures(glGenTextures_client_proc_t f) { glGenTextures_client_proc_t retval = glGenTextures; glGenTextures = f; return retval;}
|
||||
virtual glGetError_client_proc_t set_glGetError(glGetError_client_proc_t f) { glGetError_client_proc_t retval = glGetError; glGetError = f; return retval;}
|
||||
virtual glGetFixedv_client_proc_t set_glGetFixedv(glGetFixedv_client_proc_t f) { glGetFixedv_client_proc_t retval = glGetFixedv; glGetFixedv = f; return retval;}
|
||||
virtual glGetIntegerv_client_proc_t set_glGetIntegerv(glGetIntegerv_client_proc_t f) { glGetIntegerv_client_proc_t retval = glGetIntegerv; glGetIntegerv = f; return retval;}
|
||||
virtual glGetLightxv_client_proc_t set_glGetLightxv(glGetLightxv_client_proc_t f) { glGetLightxv_client_proc_t retval = glGetLightxv; glGetLightxv = f; return retval;}
|
||||
virtual glGetMaterialxv_client_proc_t set_glGetMaterialxv(glGetMaterialxv_client_proc_t f) { glGetMaterialxv_client_proc_t retval = glGetMaterialxv; glGetMaterialxv = f; return retval;}
|
||||
virtual glGetPointerv_client_proc_t set_glGetPointerv(glGetPointerv_client_proc_t f) { glGetPointerv_client_proc_t retval = glGetPointerv; glGetPointerv = f; return retval;}
|
||||
virtual glGetString_client_proc_t set_glGetString(glGetString_client_proc_t f) { glGetString_client_proc_t retval = glGetString; glGetString = f; return retval;}
|
||||
virtual glGetTexEnviv_client_proc_t set_glGetTexEnviv(glGetTexEnviv_client_proc_t f) { glGetTexEnviv_client_proc_t retval = glGetTexEnviv; glGetTexEnviv = f; return retval;}
|
||||
virtual glGetTexEnvxv_client_proc_t set_glGetTexEnvxv(glGetTexEnvxv_client_proc_t f) { glGetTexEnvxv_client_proc_t retval = glGetTexEnvxv; glGetTexEnvxv = f; return retval;}
|
||||
virtual glGetTexParameteriv_client_proc_t set_glGetTexParameteriv(glGetTexParameteriv_client_proc_t f) { glGetTexParameteriv_client_proc_t retval = glGetTexParameteriv; glGetTexParameteriv = f; return retval;}
|
||||
virtual glGetTexParameterxv_client_proc_t set_glGetTexParameterxv(glGetTexParameterxv_client_proc_t f) { glGetTexParameterxv_client_proc_t retval = glGetTexParameterxv; glGetTexParameterxv = f; return retval;}
|
||||
virtual glHint_client_proc_t set_glHint(glHint_client_proc_t f) { glHint_client_proc_t retval = glHint; glHint = f; return retval;}
|
||||
virtual glIsBuffer_client_proc_t set_glIsBuffer(glIsBuffer_client_proc_t f) { glIsBuffer_client_proc_t retval = glIsBuffer; glIsBuffer = f; return retval;}
|
||||
virtual glIsEnabled_client_proc_t set_glIsEnabled(glIsEnabled_client_proc_t f) { glIsEnabled_client_proc_t retval = glIsEnabled; glIsEnabled = f; return retval;}
|
||||
virtual glIsTexture_client_proc_t set_glIsTexture(glIsTexture_client_proc_t f) { glIsTexture_client_proc_t retval = glIsTexture; glIsTexture = f; return retval;}
|
||||
virtual glLightModelx_client_proc_t set_glLightModelx(glLightModelx_client_proc_t f) { glLightModelx_client_proc_t retval = glLightModelx; glLightModelx = f; return retval;}
|
||||
virtual glLightModelxv_client_proc_t set_glLightModelxv(glLightModelxv_client_proc_t f) { glLightModelxv_client_proc_t retval = glLightModelxv; glLightModelxv = f; return retval;}
|
||||
virtual glLightx_client_proc_t set_glLightx(glLightx_client_proc_t f) { glLightx_client_proc_t retval = glLightx; glLightx = f; return retval;}
|
||||
virtual glLightxv_client_proc_t set_glLightxv(glLightxv_client_proc_t f) { glLightxv_client_proc_t retval = glLightxv; glLightxv = f; return retval;}
|
||||
virtual glLineWidthx_client_proc_t set_glLineWidthx(glLineWidthx_client_proc_t f) { glLineWidthx_client_proc_t retval = glLineWidthx; glLineWidthx = f; return retval;}
|
||||
virtual glLoadIdentity_client_proc_t set_glLoadIdentity(glLoadIdentity_client_proc_t f) { glLoadIdentity_client_proc_t retval = glLoadIdentity; glLoadIdentity = f; return retval;}
|
||||
virtual glLoadMatrixx_client_proc_t set_glLoadMatrixx(glLoadMatrixx_client_proc_t f) { glLoadMatrixx_client_proc_t retval = glLoadMatrixx; glLoadMatrixx = f; return retval;}
|
||||
virtual glLogicOp_client_proc_t set_glLogicOp(glLogicOp_client_proc_t f) { glLogicOp_client_proc_t retval = glLogicOp; glLogicOp = f; return retval;}
|
||||
virtual glMaterialx_client_proc_t set_glMaterialx(glMaterialx_client_proc_t f) { glMaterialx_client_proc_t retval = glMaterialx; glMaterialx = f; return retval;}
|
||||
virtual glMaterialxv_client_proc_t set_glMaterialxv(glMaterialxv_client_proc_t f) { glMaterialxv_client_proc_t retval = glMaterialxv; glMaterialxv = f; return retval;}
|
||||
virtual glMatrixMode_client_proc_t set_glMatrixMode(glMatrixMode_client_proc_t f) { glMatrixMode_client_proc_t retval = glMatrixMode; glMatrixMode = f; return retval;}
|
||||
virtual glMultMatrixx_client_proc_t set_glMultMatrixx(glMultMatrixx_client_proc_t f) { glMultMatrixx_client_proc_t retval = glMultMatrixx; glMultMatrixx = f; return retval;}
|
||||
virtual glMultiTexCoord4x_client_proc_t set_glMultiTexCoord4x(glMultiTexCoord4x_client_proc_t f) { glMultiTexCoord4x_client_proc_t retval = glMultiTexCoord4x; glMultiTexCoord4x = f; return retval;}
|
||||
virtual glNormal3x_client_proc_t set_glNormal3x(glNormal3x_client_proc_t f) { glNormal3x_client_proc_t retval = glNormal3x; glNormal3x = f; return retval;}
|
||||
virtual glNormalPointer_client_proc_t set_glNormalPointer(glNormalPointer_client_proc_t f) { glNormalPointer_client_proc_t retval = glNormalPointer; glNormalPointer = f; return retval;}
|
||||
virtual glOrthox_client_proc_t set_glOrthox(glOrthox_client_proc_t f) { glOrthox_client_proc_t retval = glOrthox; glOrthox = f; return retval;}
|
||||
virtual glPixelStorei_client_proc_t set_glPixelStorei(glPixelStorei_client_proc_t f) { glPixelStorei_client_proc_t retval = glPixelStorei; glPixelStorei = f; return retval;}
|
||||
virtual glPointParameterx_client_proc_t set_glPointParameterx(glPointParameterx_client_proc_t f) { glPointParameterx_client_proc_t retval = glPointParameterx; glPointParameterx = f; return retval;}
|
||||
virtual glPointParameterxv_client_proc_t set_glPointParameterxv(glPointParameterxv_client_proc_t f) { glPointParameterxv_client_proc_t retval = glPointParameterxv; glPointParameterxv = f; return retval;}
|
||||
virtual glPointSizex_client_proc_t set_glPointSizex(glPointSizex_client_proc_t f) { glPointSizex_client_proc_t retval = glPointSizex; glPointSizex = f; return retval;}
|
||||
virtual glPolygonOffsetx_client_proc_t set_glPolygonOffsetx(glPolygonOffsetx_client_proc_t f) { glPolygonOffsetx_client_proc_t retval = glPolygonOffsetx; glPolygonOffsetx = f; return retval;}
|
||||
virtual glPopMatrix_client_proc_t set_glPopMatrix(glPopMatrix_client_proc_t f) { glPopMatrix_client_proc_t retval = glPopMatrix; glPopMatrix = f; return retval;}
|
||||
virtual glPushMatrix_client_proc_t set_glPushMatrix(glPushMatrix_client_proc_t f) { glPushMatrix_client_proc_t retval = glPushMatrix; glPushMatrix = f; return retval;}
|
||||
virtual glReadPixels_client_proc_t set_glReadPixels(glReadPixels_client_proc_t f) { glReadPixels_client_proc_t retval = glReadPixels; glReadPixels = f; return retval;}
|
||||
virtual glRotatex_client_proc_t set_glRotatex(glRotatex_client_proc_t f) { glRotatex_client_proc_t retval = glRotatex; glRotatex = f; return retval;}
|
||||
virtual glSampleCoverage_client_proc_t set_glSampleCoverage(glSampleCoverage_client_proc_t f) { glSampleCoverage_client_proc_t retval = glSampleCoverage; glSampleCoverage = f; return retval;}
|
||||
virtual glSampleCoveragex_client_proc_t set_glSampleCoveragex(glSampleCoveragex_client_proc_t f) { glSampleCoveragex_client_proc_t retval = glSampleCoveragex; glSampleCoveragex = f; return retval;}
|
||||
virtual glScalex_client_proc_t set_glScalex(glScalex_client_proc_t f) { glScalex_client_proc_t retval = glScalex; glScalex = f; return retval;}
|
||||
virtual glScissor_client_proc_t set_glScissor(glScissor_client_proc_t f) { glScissor_client_proc_t retval = glScissor; glScissor = f; return retval;}
|
||||
virtual glShadeModel_client_proc_t set_glShadeModel(glShadeModel_client_proc_t f) { glShadeModel_client_proc_t retval = glShadeModel; glShadeModel = f; return retval;}
|
||||
virtual glStencilFunc_client_proc_t set_glStencilFunc(glStencilFunc_client_proc_t f) { glStencilFunc_client_proc_t retval = glStencilFunc; glStencilFunc = f; return retval;}
|
||||
virtual glStencilMask_client_proc_t set_glStencilMask(glStencilMask_client_proc_t f) { glStencilMask_client_proc_t retval = glStencilMask; glStencilMask = f; return retval;}
|
||||
virtual glStencilOp_client_proc_t set_glStencilOp(glStencilOp_client_proc_t f) { glStencilOp_client_proc_t retval = glStencilOp; glStencilOp = f; return retval;}
|
||||
virtual glTexCoordPointer_client_proc_t set_glTexCoordPointer(glTexCoordPointer_client_proc_t f) { glTexCoordPointer_client_proc_t retval = glTexCoordPointer; glTexCoordPointer = f; return retval;}
|
||||
virtual glTexEnvi_client_proc_t set_glTexEnvi(glTexEnvi_client_proc_t f) { glTexEnvi_client_proc_t retval = glTexEnvi; glTexEnvi = f; return retval;}
|
||||
virtual glTexEnvx_client_proc_t set_glTexEnvx(glTexEnvx_client_proc_t f) { glTexEnvx_client_proc_t retval = glTexEnvx; glTexEnvx = f; return retval;}
|
||||
virtual glTexEnviv_client_proc_t set_glTexEnviv(glTexEnviv_client_proc_t f) { glTexEnviv_client_proc_t retval = glTexEnviv; glTexEnviv = f; return retval;}
|
||||
virtual glTexEnvxv_client_proc_t set_glTexEnvxv(glTexEnvxv_client_proc_t f) { glTexEnvxv_client_proc_t retval = glTexEnvxv; glTexEnvxv = f; return retval;}
|
||||
virtual glTexImage2D_client_proc_t set_glTexImage2D(glTexImage2D_client_proc_t f) { glTexImage2D_client_proc_t retval = glTexImage2D; glTexImage2D = f; return retval;}
|
||||
virtual glTexParameteri_client_proc_t set_glTexParameteri(glTexParameteri_client_proc_t f) { glTexParameteri_client_proc_t retval = glTexParameteri; glTexParameteri = f; return retval;}
|
||||
virtual glTexParameterx_client_proc_t set_glTexParameterx(glTexParameterx_client_proc_t f) { glTexParameterx_client_proc_t retval = glTexParameterx; glTexParameterx = f; return retval;}
|
||||
virtual glTexParameteriv_client_proc_t set_glTexParameteriv(glTexParameteriv_client_proc_t f) { glTexParameteriv_client_proc_t retval = glTexParameteriv; glTexParameteriv = f; return retval;}
|
||||
virtual glTexParameterxv_client_proc_t set_glTexParameterxv(glTexParameterxv_client_proc_t f) { glTexParameterxv_client_proc_t retval = glTexParameterxv; glTexParameterxv = f; return retval;}
|
||||
virtual glTexSubImage2D_client_proc_t set_glTexSubImage2D(glTexSubImage2D_client_proc_t f) { glTexSubImage2D_client_proc_t retval = glTexSubImage2D; glTexSubImage2D = f; return retval;}
|
||||
virtual glTranslatex_client_proc_t set_glTranslatex(glTranslatex_client_proc_t f) { glTranslatex_client_proc_t retval = glTranslatex; glTranslatex = f; return retval;}
|
||||
virtual glVertexPointer_client_proc_t set_glVertexPointer(glVertexPointer_client_proc_t f) { glVertexPointer_client_proc_t retval = glVertexPointer; glVertexPointer = f; return retval;}
|
||||
virtual glViewport_client_proc_t set_glViewport(glViewport_client_proc_t f) { glViewport_client_proc_t retval = glViewport; glViewport = f; return retval;}
|
||||
virtual glPointSizePointerOES_client_proc_t set_glPointSizePointerOES(glPointSizePointerOES_client_proc_t f) { glPointSizePointerOES_client_proc_t retval = glPointSizePointerOES; glPointSizePointerOES = f; return retval;}
|
||||
virtual glVertexPointerOffset_client_proc_t set_glVertexPointerOffset(glVertexPointerOffset_client_proc_t f) { glVertexPointerOffset_client_proc_t retval = glVertexPointerOffset; glVertexPointerOffset = f; return retval;}
|
||||
virtual glColorPointerOffset_client_proc_t set_glColorPointerOffset(glColorPointerOffset_client_proc_t f) { glColorPointerOffset_client_proc_t retval = glColorPointerOffset; glColorPointerOffset = f; return retval;}
|
||||
virtual glNormalPointerOffset_client_proc_t set_glNormalPointerOffset(glNormalPointerOffset_client_proc_t f) { glNormalPointerOffset_client_proc_t retval = glNormalPointerOffset; glNormalPointerOffset = f; return retval;}
|
||||
virtual glPointSizePointerOffset_client_proc_t set_glPointSizePointerOffset(glPointSizePointerOffset_client_proc_t f) { glPointSizePointerOffset_client_proc_t retval = glPointSizePointerOffset; glPointSizePointerOffset = f; return retval;}
|
||||
virtual glTexCoordPointerOffset_client_proc_t set_glTexCoordPointerOffset(glTexCoordPointerOffset_client_proc_t f) { glTexCoordPointerOffset_client_proc_t retval = glTexCoordPointerOffset; glTexCoordPointerOffset = f; return retval;}
|
||||
virtual glWeightPointerOffset_client_proc_t set_glWeightPointerOffset(glWeightPointerOffset_client_proc_t f) { glWeightPointerOffset_client_proc_t retval = glWeightPointerOffset; glWeightPointerOffset = f; return retval;}
|
||||
virtual glMatrixIndexPointerOffset_client_proc_t set_glMatrixIndexPointerOffset(glMatrixIndexPointerOffset_client_proc_t f) { glMatrixIndexPointerOffset_client_proc_t retval = glMatrixIndexPointerOffset; glMatrixIndexPointerOffset = f; return retval;}
|
||||
virtual glVertexPointerData_client_proc_t set_glVertexPointerData(glVertexPointerData_client_proc_t f) { glVertexPointerData_client_proc_t retval = glVertexPointerData; glVertexPointerData = f; return retval;}
|
||||
virtual glColorPointerData_client_proc_t set_glColorPointerData(glColorPointerData_client_proc_t f) { glColorPointerData_client_proc_t retval = glColorPointerData; glColorPointerData = f; return retval;}
|
||||
virtual glNormalPointerData_client_proc_t set_glNormalPointerData(glNormalPointerData_client_proc_t f) { glNormalPointerData_client_proc_t retval = glNormalPointerData; glNormalPointerData = f; return retval;}
|
||||
virtual glTexCoordPointerData_client_proc_t set_glTexCoordPointerData(glTexCoordPointerData_client_proc_t f) { glTexCoordPointerData_client_proc_t retval = glTexCoordPointerData; glTexCoordPointerData = f; return retval;}
|
||||
virtual glPointSizePointerData_client_proc_t set_glPointSizePointerData(glPointSizePointerData_client_proc_t f) { glPointSizePointerData_client_proc_t retval = glPointSizePointerData; glPointSizePointerData = f; return retval;}
|
||||
virtual glWeightPointerData_client_proc_t set_glWeightPointerData(glWeightPointerData_client_proc_t f) { glWeightPointerData_client_proc_t retval = glWeightPointerData; glWeightPointerData = f; return retval;}
|
||||
virtual glMatrixIndexPointerData_client_proc_t set_glMatrixIndexPointerData(glMatrixIndexPointerData_client_proc_t f) { glMatrixIndexPointerData_client_proc_t retval = glMatrixIndexPointerData; glMatrixIndexPointerData = f; return retval;}
|
||||
virtual glDrawElementsOffset_client_proc_t set_glDrawElementsOffset(glDrawElementsOffset_client_proc_t f) { glDrawElementsOffset_client_proc_t retval = glDrawElementsOffset; glDrawElementsOffset = f; return retval;}
|
||||
virtual glDrawElementsData_client_proc_t set_glDrawElementsData(glDrawElementsData_client_proc_t f) { glDrawElementsData_client_proc_t retval = glDrawElementsData; glDrawElementsData = f; return retval;}
|
||||
virtual glGetCompressedTextureFormats_client_proc_t set_glGetCompressedTextureFormats(glGetCompressedTextureFormats_client_proc_t f) { glGetCompressedTextureFormats_client_proc_t retval = glGetCompressedTextureFormats; glGetCompressedTextureFormats = f; return retval;}
|
||||
virtual glFinishRoundTrip_client_proc_t set_glFinishRoundTrip(glFinishRoundTrip_client_proc_t f) { glFinishRoundTrip_client_proc_t retval = glFinishRoundTrip; glFinishRoundTrip = f; return retval;}
|
||||
virtual glBlendEquationSeparateOES_client_proc_t set_glBlendEquationSeparateOES(glBlendEquationSeparateOES_client_proc_t f) { glBlendEquationSeparateOES_client_proc_t retval = glBlendEquationSeparateOES; glBlendEquationSeparateOES = f; return retval;}
|
||||
virtual glBlendFuncSeparateOES_client_proc_t set_glBlendFuncSeparateOES(glBlendFuncSeparateOES_client_proc_t f) { glBlendFuncSeparateOES_client_proc_t retval = glBlendFuncSeparateOES; glBlendFuncSeparateOES = f; return retval;}
|
||||
virtual glBlendEquationOES_client_proc_t set_glBlendEquationOES(glBlendEquationOES_client_proc_t f) { glBlendEquationOES_client_proc_t retval = glBlendEquationOES; glBlendEquationOES = f; return retval;}
|
||||
virtual glDrawTexsOES_client_proc_t set_glDrawTexsOES(glDrawTexsOES_client_proc_t f) { glDrawTexsOES_client_proc_t retval = glDrawTexsOES; glDrawTexsOES = f; return retval;}
|
||||
virtual glDrawTexiOES_client_proc_t set_glDrawTexiOES(glDrawTexiOES_client_proc_t f) { glDrawTexiOES_client_proc_t retval = glDrawTexiOES; glDrawTexiOES = f; return retval;}
|
||||
virtual glDrawTexxOES_client_proc_t set_glDrawTexxOES(glDrawTexxOES_client_proc_t f) { glDrawTexxOES_client_proc_t retval = glDrawTexxOES; glDrawTexxOES = f; return retval;}
|
||||
virtual glDrawTexsvOES_client_proc_t set_glDrawTexsvOES(glDrawTexsvOES_client_proc_t f) { glDrawTexsvOES_client_proc_t retval = glDrawTexsvOES; glDrawTexsvOES = f; return retval;}
|
||||
virtual glDrawTexivOES_client_proc_t set_glDrawTexivOES(glDrawTexivOES_client_proc_t f) { glDrawTexivOES_client_proc_t retval = glDrawTexivOES; glDrawTexivOES = f; return retval;}
|
||||
virtual glDrawTexxvOES_client_proc_t set_glDrawTexxvOES(glDrawTexxvOES_client_proc_t f) { glDrawTexxvOES_client_proc_t retval = glDrawTexxvOES; glDrawTexxvOES = f; return retval;}
|
||||
virtual glDrawTexfOES_client_proc_t set_glDrawTexfOES(glDrawTexfOES_client_proc_t f) { glDrawTexfOES_client_proc_t retval = glDrawTexfOES; glDrawTexfOES = f; return retval;}
|
||||
virtual glDrawTexfvOES_client_proc_t set_glDrawTexfvOES(glDrawTexfvOES_client_proc_t f) { glDrawTexfvOES_client_proc_t retval = glDrawTexfvOES; glDrawTexfvOES = f; return retval;}
|
||||
virtual glEGLImageTargetTexture2DOES_client_proc_t set_glEGLImageTargetTexture2DOES(glEGLImageTargetTexture2DOES_client_proc_t f) { glEGLImageTargetTexture2DOES_client_proc_t retval = glEGLImageTargetTexture2DOES; glEGLImageTargetTexture2DOES = f; return retval;}
|
||||
virtual glEGLImageTargetRenderbufferStorageOES_client_proc_t set_glEGLImageTargetRenderbufferStorageOES(glEGLImageTargetRenderbufferStorageOES_client_proc_t f) { glEGLImageTargetRenderbufferStorageOES_client_proc_t retval = glEGLImageTargetRenderbufferStorageOES; glEGLImageTargetRenderbufferStorageOES = f; return retval;}
|
||||
virtual glAlphaFuncxOES_client_proc_t set_glAlphaFuncxOES(glAlphaFuncxOES_client_proc_t f) { glAlphaFuncxOES_client_proc_t retval = glAlphaFuncxOES; glAlphaFuncxOES = f; return retval;}
|
||||
virtual glClearColorxOES_client_proc_t set_glClearColorxOES(glClearColorxOES_client_proc_t f) { glClearColorxOES_client_proc_t retval = glClearColorxOES; glClearColorxOES = f; return retval;}
|
||||
virtual glClearDepthxOES_client_proc_t set_glClearDepthxOES(glClearDepthxOES_client_proc_t f) { glClearDepthxOES_client_proc_t retval = glClearDepthxOES; glClearDepthxOES = f; return retval;}
|
||||
virtual glClipPlanexOES_client_proc_t set_glClipPlanexOES(glClipPlanexOES_client_proc_t f) { glClipPlanexOES_client_proc_t retval = glClipPlanexOES; glClipPlanexOES = f; return retval;}
|
||||
virtual glClipPlanexIMG_client_proc_t set_glClipPlanexIMG(glClipPlanexIMG_client_proc_t f) { glClipPlanexIMG_client_proc_t retval = glClipPlanexIMG; glClipPlanexIMG = f; return retval;}
|
||||
virtual glColor4xOES_client_proc_t set_glColor4xOES(glColor4xOES_client_proc_t f) { glColor4xOES_client_proc_t retval = glColor4xOES; glColor4xOES = f; return retval;}
|
||||
virtual glDepthRangexOES_client_proc_t set_glDepthRangexOES(glDepthRangexOES_client_proc_t f) { glDepthRangexOES_client_proc_t retval = glDepthRangexOES; glDepthRangexOES = f; return retval;}
|
||||
virtual glFogxOES_client_proc_t set_glFogxOES(glFogxOES_client_proc_t f) { glFogxOES_client_proc_t retval = glFogxOES; glFogxOES = f; return retval;}
|
||||
virtual glFogxvOES_client_proc_t set_glFogxvOES(glFogxvOES_client_proc_t f) { glFogxvOES_client_proc_t retval = glFogxvOES; glFogxvOES = f; return retval;}
|
||||
virtual glFrustumxOES_client_proc_t set_glFrustumxOES(glFrustumxOES_client_proc_t f) { glFrustumxOES_client_proc_t retval = glFrustumxOES; glFrustumxOES = f; return retval;}
|
||||
virtual glGetClipPlanexOES_client_proc_t set_glGetClipPlanexOES(glGetClipPlanexOES_client_proc_t f) { glGetClipPlanexOES_client_proc_t retval = glGetClipPlanexOES; glGetClipPlanexOES = f; return retval;}
|
||||
virtual glGetClipPlanex_client_proc_t set_glGetClipPlanex(glGetClipPlanex_client_proc_t f) { glGetClipPlanex_client_proc_t retval = glGetClipPlanex; glGetClipPlanex = f; return retval;}
|
||||
virtual glGetFixedvOES_client_proc_t set_glGetFixedvOES(glGetFixedvOES_client_proc_t f) { glGetFixedvOES_client_proc_t retval = glGetFixedvOES; glGetFixedvOES = f; return retval;}
|
||||
virtual glGetLightxvOES_client_proc_t set_glGetLightxvOES(glGetLightxvOES_client_proc_t f) { glGetLightxvOES_client_proc_t retval = glGetLightxvOES; glGetLightxvOES = f; return retval;}
|
||||
virtual glGetMaterialxvOES_client_proc_t set_glGetMaterialxvOES(glGetMaterialxvOES_client_proc_t f) { glGetMaterialxvOES_client_proc_t retval = glGetMaterialxvOES; glGetMaterialxvOES = f; return retval;}
|
||||
virtual glGetTexEnvxvOES_client_proc_t set_glGetTexEnvxvOES(glGetTexEnvxvOES_client_proc_t f) { glGetTexEnvxvOES_client_proc_t retval = glGetTexEnvxvOES; glGetTexEnvxvOES = f; return retval;}
|
||||
virtual glGetTexParameterxvOES_client_proc_t set_glGetTexParameterxvOES(glGetTexParameterxvOES_client_proc_t f) { glGetTexParameterxvOES_client_proc_t retval = glGetTexParameterxvOES; glGetTexParameterxvOES = f; return retval;}
|
||||
virtual glLightModelxOES_client_proc_t set_glLightModelxOES(glLightModelxOES_client_proc_t f) { glLightModelxOES_client_proc_t retval = glLightModelxOES; glLightModelxOES = f; return retval;}
|
||||
virtual glLightModelxvOES_client_proc_t set_glLightModelxvOES(glLightModelxvOES_client_proc_t f) { glLightModelxvOES_client_proc_t retval = glLightModelxvOES; glLightModelxvOES = f; return retval;}
|
||||
virtual glLightxOES_client_proc_t set_glLightxOES(glLightxOES_client_proc_t f) { glLightxOES_client_proc_t retval = glLightxOES; glLightxOES = f; return retval;}
|
||||
virtual glLightxvOES_client_proc_t set_glLightxvOES(glLightxvOES_client_proc_t f) { glLightxvOES_client_proc_t retval = glLightxvOES; glLightxvOES = f; return retval;}
|
||||
virtual glLineWidthxOES_client_proc_t set_glLineWidthxOES(glLineWidthxOES_client_proc_t f) { glLineWidthxOES_client_proc_t retval = glLineWidthxOES; glLineWidthxOES = f; return retval;}
|
||||
virtual glLoadMatrixxOES_client_proc_t set_glLoadMatrixxOES(glLoadMatrixxOES_client_proc_t f) { glLoadMatrixxOES_client_proc_t retval = glLoadMatrixxOES; glLoadMatrixxOES = f; return retval;}
|
||||
virtual glMaterialxOES_client_proc_t set_glMaterialxOES(glMaterialxOES_client_proc_t f) { glMaterialxOES_client_proc_t retval = glMaterialxOES; glMaterialxOES = f; return retval;}
|
||||
virtual glMaterialxvOES_client_proc_t set_glMaterialxvOES(glMaterialxvOES_client_proc_t f) { glMaterialxvOES_client_proc_t retval = glMaterialxvOES; glMaterialxvOES = f; return retval;}
|
||||
virtual glMultMatrixxOES_client_proc_t set_glMultMatrixxOES(glMultMatrixxOES_client_proc_t f) { glMultMatrixxOES_client_proc_t retval = glMultMatrixxOES; glMultMatrixxOES = f; return retval;}
|
||||
virtual glMultiTexCoord4xOES_client_proc_t set_glMultiTexCoord4xOES(glMultiTexCoord4xOES_client_proc_t f) { glMultiTexCoord4xOES_client_proc_t retval = glMultiTexCoord4xOES; glMultiTexCoord4xOES = f; return retval;}
|
||||
virtual glNormal3xOES_client_proc_t set_glNormal3xOES(glNormal3xOES_client_proc_t f) { glNormal3xOES_client_proc_t retval = glNormal3xOES; glNormal3xOES = f; return retval;}
|
||||
virtual glOrthoxOES_client_proc_t set_glOrthoxOES(glOrthoxOES_client_proc_t f) { glOrthoxOES_client_proc_t retval = glOrthoxOES; glOrthoxOES = f; return retval;}
|
||||
virtual glPointParameterxOES_client_proc_t set_glPointParameterxOES(glPointParameterxOES_client_proc_t f) { glPointParameterxOES_client_proc_t retval = glPointParameterxOES; glPointParameterxOES = f; return retval;}
|
||||
virtual glPointParameterxvOES_client_proc_t set_glPointParameterxvOES(glPointParameterxvOES_client_proc_t f) { glPointParameterxvOES_client_proc_t retval = glPointParameterxvOES; glPointParameterxvOES = f; return retval;}
|
||||
virtual glPointSizexOES_client_proc_t set_glPointSizexOES(glPointSizexOES_client_proc_t f) { glPointSizexOES_client_proc_t retval = glPointSizexOES; glPointSizexOES = f; return retval;}
|
||||
virtual glPolygonOffsetxOES_client_proc_t set_glPolygonOffsetxOES(glPolygonOffsetxOES_client_proc_t f) { glPolygonOffsetxOES_client_proc_t retval = glPolygonOffsetxOES; glPolygonOffsetxOES = f; return retval;}
|
||||
virtual glRotatexOES_client_proc_t set_glRotatexOES(glRotatexOES_client_proc_t f) { glRotatexOES_client_proc_t retval = glRotatexOES; glRotatexOES = f; return retval;}
|
||||
virtual glSampleCoveragexOES_client_proc_t set_glSampleCoveragexOES(glSampleCoveragexOES_client_proc_t f) { glSampleCoveragexOES_client_proc_t retval = glSampleCoveragexOES; glSampleCoveragexOES = f; return retval;}
|
||||
virtual glScalexOES_client_proc_t set_glScalexOES(glScalexOES_client_proc_t f) { glScalexOES_client_proc_t retval = glScalexOES; glScalexOES = f; return retval;}
|
||||
virtual glTexEnvxOES_client_proc_t set_glTexEnvxOES(glTexEnvxOES_client_proc_t f) { glTexEnvxOES_client_proc_t retval = glTexEnvxOES; glTexEnvxOES = f; return retval;}
|
||||
virtual glTexEnvxvOES_client_proc_t set_glTexEnvxvOES(glTexEnvxvOES_client_proc_t f) { glTexEnvxvOES_client_proc_t retval = glTexEnvxvOES; glTexEnvxvOES = f; return retval;}
|
||||
virtual glTexParameterxOES_client_proc_t set_glTexParameterxOES(glTexParameterxOES_client_proc_t f) { glTexParameterxOES_client_proc_t retval = glTexParameterxOES; glTexParameterxOES = f; return retval;}
|
||||
virtual glTexParameterxvOES_client_proc_t set_glTexParameterxvOES(glTexParameterxvOES_client_proc_t f) { glTexParameterxvOES_client_proc_t retval = glTexParameterxvOES; glTexParameterxvOES = f; return retval;}
|
||||
virtual glTranslatexOES_client_proc_t set_glTranslatexOES(glTranslatexOES_client_proc_t f) { glTranslatexOES_client_proc_t retval = glTranslatexOES; glTranslatexOES = f; return retval;}
|
||||
virtual glIsRenderbufferOES_client_proc_t set_glIsRenderbufferOES(glIsRenderbufferOES_client_proc_t f) { glIsRenderbufferOES_client_proc_t retval = glIsRenderbufferOES; glIsRenderbufferOES = f; return retval;}
|
||||
virtual glBindRenderbufferOES_client_proc_t set_glBindRenderbufferOES(glBindRenderbufferOES_client_proc_t f) { glBindRenderbufferOES_client_proc_t retval = glBindRenderbufferOES; glBindRenderbufferOES = f; return retval;}
|
||||
virtual glDeleteRenderbuffersOES_client_proc_t set_glDeleteRenderbuffersOES(glDeleteRenderbuffersOES_client_proc_t f) { glDeleteRenderbuffersOES_client_proc_t retval = glDeleteRenderbuffersOES; glDeleteRenderbuffersOES = f; return retval;}
|
||||
virtual glGenRenderbuffersOES_client_proc_t set_glGenRenderbuffersOES(glGenRenderbuffersOES_client_proc_t f) { glGenRenderbuffersOES_client_proc_t retval = glGenRenderbuffersOES; glGenRenderbuffersOES = f; return retval;}
|
||||
virtual glRenderbufferStorageOES_client_proc_t set_glRenderbufferStorageOES(glRenderbufferStorageOES_client_proc_t f) { glRenderbufferStorageOES_client_proc_t retval = glRenderbufferStorageOES; glRenderbufferStorageOES = f; return retval;}
|
||||
virtual glGetRenderbufferParameterivOES_client_proc_t set_glGetRenderbufferParameterivOES(glGetRenderbufferParameterivOES_client_proc_t f) { glGetRenderbufferParameterivOES_client_proc_t retval = glGetRenderbufferParameterivOES; glGetRenderbufferParameterivOES = f; return retval;}
|
||||
virtual glIsFramebufferOES_client_proc_t set_glIsFramebufferOES(glIsFramebufferOES_client_proc_t f) { glIsFramebufferOES_client_proc_t retval = glIsFramebufferOES; glIsFramebufferOES = f; return retval;}
|
||||
virtual glBindFramebufferOES_client_proc_t set_glBindFramebufferOES(glBindFramebufferOES_client_proc_t f) { glBindFramebufferOES_client_proc_t retval = glBindFramebufferOES; glBindFramebufferOES = f; return retval;}
|
||||
virtual glDeleteFramebuffersOES_client_proc_t set_glDeleteFramebuffersOES(glDeleteFramebuffersOES_client_proc_t f) { glDeleteFramebuffersOES_client_proc_t retval = glDeleteFramebuffersOES; glDeleteFramebuffersOES = f; return retval;}
|
||||
virtual glGenFramebuffersOES_client_proc_t set_glGenFramebuffersOES(glGenFramebuffersOES_client_proc_t f) { glGenFramebuffersOES_client_proc_t retval = glGenFramebuffersOES; glGenFramebuffersOES = f; return retval;}
|
||||
virtual glCheckFramebufferStatusOES_client_proc_t set_glCheckFramebufferStatusOES(glCheckFramebufferStatusOES_client_proc_t f) { glCheckFramebufferStatusOES_client_proc_t retval = glCheckFramebufferStatusOES; glCheckFramebufferStatusOES = f; return retval;}
|
||||
virtual glFramebufferRenderbufferOES_client_proc_t set_glFramebufferRenderbufferOES(glFramebufferRenderbufferOES_client_proc_t f) { glFramebufferRenderbufferOES_client_proc_t retval = glFramebufferRenderbufferOES; glFramebufferRenderbufferOES = f; return retval;}
|
||||
virtual glFramebufferTexture2DOES_client_proc_t set_glFramebufferTexture2DOES(glFramebufferTexture2DOES_client_proc_t f) { glFramebufferTexture2DOES_client_proc_t retval = glFramebufferTexture2DOES; glFramebufferTexture2DOES = f; return retval;}
|
||||
virtual glGetFramebufferAttachmentParameterivOES_client_proc_t set_glGetFramebufferAttachmentParameterivOES(glGetFramebufferAttachmentParameterivOES_client_proc_t f) { glGetFramebufferAttachmentParameterivOES_client_proc_t retval = glGetFramebufferAttachmentParameterivOES; glGetFramebufferAttachmentParameterivOES = f; return retval;}
|
||||
virtual glGenerateMipmapOES_client_proc_t set_glGenerateMipmapOES(glGenerateMipmapOES_client_proc_t f) { glGenerateMipmapOES_client_proc_t retval = glGenerateMipmapOES; glGenerateMipmapOES = f; return retval;}
|
||||
virtual glMapBufferOES_client_proc_t set_glMapBufferOES(glMapBufferOES_client_proc_t f) { glMapBufferOES_client_proc_t retval = glMapBufferOES; glMapBufferOES = f; return retval;}
|
||||
virtual glUnmapBufferOES_client_proc_t set_glUnmapBufferOES(glUnmapBufferOES_client_proc_t f) { glUnmapBufferOES_client_proc_t retval = glUnmapBufferOES; glUnmapBufferOES = f; return retval;}
|
||||
virtual glGetBufferPointervOES_client_proc_t set_glGetBufferPointervOES(glGetBufferPointervOES_client_proc_t f) { glGetBufferPointervOES_client_proc_t retval = glGetBufferPointervOES; glGetBufferPointervOES = f; return retval;}
|
||||
virtual glCurrentPaletteMatrixOES_client_proc_t set_glCurrentPaletteMatrixOES(glCurrentPaletteMatrixOES_client_proc_t f) { glCurrentPaletteMatrixOES_client_proc_t retval = glCurrentPaletteMatrixOES; glCurrentPaletteMatrixOES = f; return retval;}
|
||||
virtual glLoadPaletteFromModelViewMatrixOES_client_proc_t set_glLoadPaletteFromModelViewMatrixOES(glLoadPaletteFromModelViewMatrixOES_client_proc_t f) { glLoadPaletteFromModelViewMatrixOES_client_proc_t retval = glLoadPaletteFromModelViewMatrixOES; glLoadPaletteFromModelViewMatrixOES = f; return retval;}
|
||||
virtual glMatrixIndexPointerOES_client_proc_t set_glMatrixIndexPointerOES(glMatrixIndexPointerOES_client_proc_t f) { glMatrixIndexPointerOES_client_proc_t retval = glMatrixIndexPointerOES; glMatrixIndexPointerOES = f; return retval;}
|
||||
virtual glWeightPointerOES_client_proc_t set_glWeightPointerOES(glWeightPointerOES_client_proc_t f) { glWeightPointerOES_client_proc_t retval = glWeightPointerOES; glWeightPointerOES = f; return retval;}
|
||||
virtual glQueryMatrixxOES_client_proc_t set_glQueryMatrixxOES(glQueryMatrixxOES_client_proc_t f) { glQueryMatrixxOES_client_proc_t retval = glQueryMatrixxOES; glQueryMatrixxOES = f; return retval;}
|
||||
virtual glDepthRangefOES_client_proc_t set_glDepthRangefOES(glDepthRangefOES_client_proc_t f) { glDepthRangefOES_client_proc_t retval = glDepthRangefOES; glDepthRangefOES = f; return retval;}
|
||||
virtual glFrustumfOES_client_proc_t set_glFrustumfOES(glFrustumfOES_client_proc_t f) { glFrustumfOES_client_proc_t retval = glFrustumfOES; glFrustumfOES = f; return retval;}
|
||||
virtual glOrthofOES_client_proc_t set_glOrthofOES(glOrthofOES_client_proc_t f) { glOrthofOES_client_proc_t retval = glOrthofOES; glOrthofOES = f; return retval;}
|
||||
virtual glClipPlanefOES_client_proc_t set_glClipPlanefOES(glClipPlanefOES_client_proc_t f) { glClipPlanefOES_client_proc_t retval = glClipPlanefOES; glClipPlanefOES = f; return retval;}
|
||||
virtual glClipPlanefIMG_client_proc_t set_glClipPlanefIMG(glClipPlanefIMG_client_proc_t f) { glClipPlanefIMG_client_proc_t retval = glClipPlanefIMG; glClipPlanefIMG = f; return retval;}
|
||||
virtual glGetClipPlanefOES_client_proc_t set_glGetClipPlanefOES(glGetClipPlanefOES_client_proc_t f) { glGetClipPlanefOES_client_proc_t retval = glGetClipPlanefOES; glGetClipPlanefOES = f; return retval;}
|
||||
virtual glClearDepthfOES_client_proc_t set_glClearDepthfOES(glClearDepthfOES_client_proc_t f) { glClearDepthfOES_client_proc_t retval = glClearDepthfOES; glClearDepthfOES = f; return retval;}
|
||||
virtual glTexGenfOES_client_proc_t set_glTexGenfOES(glTexGenfOES_client_proc_t f) { glTexGenfOES_client_proc_t retval = glTexGenfOES; glTexGenfOES = f; return retval;}
|
||||
virtual glTexGenfvOES_client_proc_t set_glTexGenfvOES(glTexGenfvOES_client_proc_t f) { glTexGenfvOES_client_proc_t retval = glTexGenfvOES; glTexGenfvOES = f; return retval;}
|
||||
virtual glTexGeniOES_client_proc_t set_glTexGeniOES(glTexGeniOES_client_proc_t f) { glTexGeniOES_client_proc_t retval = glTexGeniOES; glTexGeniOES = f; return retval;}
|
||||
virtual glTexGenivOES_client_proc_t set_glTexGenivOES(glTexGenivOES_client_proc_t f) { glTexGenivOES_client_proc_t retval = glTexGenivOES; glTexGenivOES = f; return retval;}
|
||||
virtual glTexGenxOES_client_proc_t set_glTexGenxOES(glTexGenxOES_client_proc_t f) { glTexGenxOES_client_proc_t retval = glTexGenxOES; glTexGenxOES = f; return retval;}
|
||||
virtual glTexGenxvOES_client_proc_t set_glTexGenxvOES(glTexGenxvOES_client_proc_t f) { glTexGenxvOES_client_proc_t retval = glTexGenxvOES; glTexGenxvOES = f; return retval;}
|
||||
virtual glGetTexGenfvOES_client_proc_t set_glGetTexGenfvOES(glGetTexGenfvOES_client_proc_t f) { glGetTexGenfvOES_client_proc_t retval = glGetTexGenfvOES; glGetTexGenfvOES = f; return retval;}
|
||||
virtual glGetTexGenivOES_client_proc_t set_glGetTexGenivOES(glGetTexGenivOES_client_proc_t f) { glGetTexGenivOES_client_proc_t retval = glGetTexGenivOES; glGetTexGenivOES = f; return retval;}
|
||||
virtual glGetTexGenxvOES_client_proc_t set_glGetTexGenxvOES(glGetTexGenxvOES_client_proc_t f) { glGetTexGenxvOES_client_proc_t retval = glGetTexGenxvOES; glGetTexGenxvOES = f; return retval;}
|
||||
virtual glBindVertexArrayOES_client_proc_t set_glBindVertexArrayOES(glBindVertexArrayOES_client_proc_t f) { glBindVertexArrayOES_client_proc_t retval = glBindVertexArrayOES; glBindVertexArrayOES = f; return retval;}
|
||||
virtual glDeleteVertexArraysOES_client_proc_t set_glDeleteVertexArraysOES(glDeleteVertexArraysOES_client_proc_t f) { glDeleteVertexArraysOES_client_proc_t retval = glDeleteVertexArraysOES; glDeleteVertexArraysOES = f; return retval;}
|
||||
virtual glGenVertexArraysOES_client_proc_t set_glGenVertexArraysOES(glGenVertexArraysOES_client_proc_t f) { glGenVertexArraysOES_client_proc_t retval = glGenVertexArraysOES; glGenVertexArraysOES = f; return retval;}
|
||||
virtual glIsVertexArrayOES_client_proc_t set_glIsVertexArrayOES(glIsVertexArrayOES_client_proc_t f) { glIsVertexArrayOES_client_proc_t retval = glIsVertexArrayOES; glIsVertexArrayOES = f; return retval;}
|
||||
virtual glDiscardFramebufferEXT_client_proc_t set_glDiscardFramebufferEXT(glDiscardFramebufferEXT_client_proc_t f) { glDiscardFramebufferEXT_client_proc_t retval = glDiscardFramebufferEXT; glDiscardFramebufferEXT = f; return retval;}
|
||||
virtual glMultiDrawArraysEXT_client_proc_t set_glMultiDrawArraysEXT(glMultiDrawArraysEXT_client_proc_t f) { glMultiDrawArraysEXT_client_proc_t retval = glMultiDrawArraysEXT; glMultiDrawArraysEXT = f; return retval;}
|
||||
virtual glMultiDrawElementsEXT_client_proc_t set_glMultiDrawElementsEXT(glMultiDrawElementsEXT_client_proc_t f) { glMultiDrawElementsEXT_client_proc_t retval = glMultiDrawElementsEXT; glMultiDrawElementsEXT = f; return retval;}
|
||||
virtual glMultiDrawArraysSUN_client_proc_t set_glMultiDrawArraysSUN(glMultiDrawArraysSUN_client_proc_t f) { glMultiDrawArraysSUN_client_proc_t retval = glMultiDrawArraysSUN; glMultiDrawArraysSUN = f; return retval;}
|
||||
virtual glMultiDrawElementsSUN_client_proc_t set_glMultiDrawElementsSUN(glMultiDrawElementsSUN_client_proc_t f) { glMultiDrawElementsSUN_client_proc_t retval = glMultiDrawElementsSUN; glMultiDrawElementsSUN = f; return retval;}
|
||||
virtual glRenderbufferStorageMultisampleIMG_client_proc_t set_glRenderbufferStorageMultisampleIMG(glRenderbufferStorageMultisampleIMG_client_proc_t f) { glRenderbufferStorageMultisampleIMG_client_proc_t retval = glRenderbufferStorageMultisampleIMG; glRenderbufferStorageMultisampleIMG = f; return retval;}
|
||||
virtual glFramebufferTexture2DMultisampleIMG_client_proc_t set_glFramebufferTexture2DMultisampleIMG(glFramebufferTexture2DMultisampleIMG_client_proc_t f) { glFramebufferTexture2DMultisampleIMG_client_proc_t retval = glFramebufferTexture2DMultisampleIMG; glFramebufferTexture2DMultisampleIMG = f; return retval;}
|
||||
virtual glDeleteFencesNV_client_proc_t set_glDeleteFencesNV(glDeleteFencesNV_client_proc_t f) { glDeleteFencesNV_client_proc_t retval = glDeleteFencesNV; glDeleteFencesNV = f; return retval;}
|
||||
virtual glGenFencesNV_client_proc_t set_glGenFencesNV(glGenFencesNV_client_proc_t f) { glGenFencesNV_client_proc_t retval = glGenFencesNV; glGenFencesNV = f; return retval;}
|
||||
virtual glIsFenceNV_client_proc_t set_glIsFenceNV(glIsFenceNV_client_proc_t f) { glIsFenceNV_client_proc_t retval = glIsFenceNV; glIsFenceNV = f; return retval;}
|
||||
virtual glTestFenceNV_client_proc_t set_glTestFenceNV(glTestFenceNV_client_proc_t f) { glTestFenceNV_client_proc_t retval = glTestFenceNV; glTestFenceNV = f; return retval;}
|
||||
virtual glGetFenceivNV_client_proc_t set_glGetFenceivNV(glGetFenceivNV_client_proc_t f) { glGetFenceivNV_client_proc_t retval = glGetFenceivNV; glGetFenceivNV = f; return retval;}
|
||||
virtual glFinishFenceNV_client_proc_t set_glFinishFenceNV(glFinishFenceNV_client_proc_t f) { glFinishFenceNV_client_proc_t retval = glFinishFenceNV; glFinishFenceNV = f; return retval;}
|
||||
virtual glSetFenceNV_client_proc_t set_glSetFenceNV(glSetFenceNV_client_proc_t f) { glSetFenceNV_client_proc_t retval = glSetFenceNV; glSetFenceNV = f; return retval;}
|
||||
virtual glGetDriverControlsQCOM_client_proc_t set_glGetDriverControlsQCOM(glGetDriverControlsQCOM_client_proc_t f) { glGetDriverControlsQCOM_client_proc_t retval = glGetDriverControlsQCOM; glGetDriverControlsQCOM = f; return retval;}
|
||||
virtual glGetDriverControlStringQCOM_client_proc_t set_glGetDriverControlStringQCOM(glGetDriverControlStringQCOM_client_proc_t f) { glGetDriverControlStringQCOM_client_proc_t retval = glGetDriverControlStringQCOM; glGetDriverControlStringQCOM = f; return retval;}
|
||||
virtual glEnableDriverControlQCOM_client_proc_t set_glEnableDriverControlQCOM(glEnableDriverControlQCOM_client_proc_t f) { glEnableDriverControlQCOM_client_proc_t retval = glEnableDriverControlQCOM; glEnableDriverControlQCOM = f; return retval;}
|
||||
virtual glDisableDriverControlQCOM_client_proc_t set_glDisableDriverControlQCOM(glDisableDriverControlQCOM_client_proc_t f) { glDisableDriverControlQCOM_client_proc_t retval = glDisableDriverControlQCOM; glDisableDriverControlQCOM = f; return retval;}
|
||||
virtual glExtGetTexturesQCOM_client_proc_t set_glExtGetTexturesQCOM(glExtGetTexturesQCOM_client_proc_t f) { glExtGetTexturesQCOM_client_proc_t retval = glExtGetTexturesQCOM; glExtGetTexturesQCOM = f; return retval;}
|
||||
virtual glExtGetBuffersQCOM_client_proc_t set_glExtGetBuffersQCOM(glExtGetBuffersQCOM_client_proc_t f) { glExtGetBuffersQCOM_client_proc_t retval = glExtGetBuffersQCOM; glExtGetBuffersQCOM = f; return retval;}
|
||||
virtual glExtGetRenderbuffersQCOM_client_proc_t set_glExtGetRenderbuffersQCOM(glExtGetRenderbuffersQCOM_client_proc_t f) { glExtGetRenderbuffersQCOM_client_proc_t retval = glExtGetRenderbuffersQCOM; glExtGetRenderbuffersQCOM = f; return retval;}
|
||||
virtual glExtGetFramebuffersQCOM_client_proc_t set_glExtGetFramebuffersQCOM(glExtGetFramebuffersQCOM_client_proc_t f) { glExtGetFramebuffersQCOM_client_proc_t retval = glExtGetFramebuffersQCOM; glExtGetFramebuffersQCOM = f; return retval;}
|
||||
virtual glExtGetTexLevelParameterivQCOM_client_proc_t set_glExtGetTexLevelParameterivQCOM(glExtGetTexLevelParameterivQCOM_client_proc_t f) { glExtGetTexLevelParameterivQCOM_client_proc_t retval = glExtGetTexLevelParameterivQCOM; glExtGetTexLevelParameterivQCOM = f; return retval;}
|
||||
virtual glExtTexObjectStateOverrideiQCOM_client_proc_t set_glExtTexObjectStateOverrideiQCOM(glExtTexObjectStateOverrideiQCOM_client_proc_t f) { glExtTexObjectStateOverrideiQCOM_client_proc_t retval = glExtTexObjectStateOverrideiQCOM; glExtTexObjectStateOverrideiQCOM = f; return retval;}
|
||||
virtual glExtGetTexSubImageQCOM_client_proc_t set_glExtGetTexSubImageQCOM(glExtGetTexSubImageQCOM_client_proc_t f) { glExtGetTexSubImageQCOM_client_proc_t retval = glExtGetTexSubImageQCOM; glExtGetTexSubImageQCOM = f; return retval;}
|
||||
virtual glExtGetBufferPointervQCOM_client_proc_t set_glExtGetBufferPointervQCOM(glExtGetBufferPointervQCOM_client_proc_t f) { glExtGetBufferPointervQCOM_client_proc_t retval = glExtGetBufferPointervQCOM; glExtGetBufferPointervQCOM = f; return retval;}
|
||||
virtual glExtGetShadersQCOM_client_proc_t set_glExtGetShadersQCOM(glExtGetShadersQCOM_client_proc_t f) { glExtGetShadersQCOM_client_proc_t retval = glExtGetShadersQCOM; glExtGetShadersQCOM = f; return retval;}
|
||||
virtual glExtGetProgramsQCOM_client_proc_t set_glExtGetProgramsQCOM(glExtGetProgramsQCOM_client_proc_t f) { glExtGetProgramsQCOM_client_proc_t retval = glExtGetProgramsQCOM; glExtGetProgramsQCOM = f; return retval;}
|
||||
virtual glExtIsProgramBinaryQCOM_client_proc_t set_glExtIsProgramBinaryQCOM(glExtIsProgramBinaryQCOM_client_proc_t f) { glExtIsProgramBinaryQCOM_client_proc_t retval = glExtIsProgramBinaryQCOM; glExtIsProgramBinaryQCOM = f; return retval;}
|
||||
virtual glExtGetProgramBinarySourceQCOM_client_proc_t set_glExtGetProgramBinarySourceQCOM(glExtGetProgramBinarySourceQCOM_client_proc_t f) { glExtGetProgramBinarySourceQCOM_client_proc_t retval = glExtGetProgramBinarySourceQCOM; glExtGetProgramBinarySourceQCOM = f; return retval;}
|
||||
virtual glStartTilingQCOM_client_proc_t set_glStartTilingQCOM(glStartTilingQCOM_client_proc_t f) { glStartTilingQCOM_client_proc_t retval = glStartTilingQCOM; glStartTilingQCOM = f; return retval;}
|
||||
virtual glEndTilingQCOM_client_proc_t set_glEndTilingQCOM(glEndTilingQCOM_client_proc_t f) { glEndTilingQCOM_client_proc_t retval = glEndTilingQCOM; glEndTilingQCOM = f; return retval;}
|
||||
virtual ~gl_client_context_t() {}
|
||||
|
||||
typedef gl_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
|
||||
static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
|
||||
int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
|
||||
virtual void setError(unsigned int error){};
|
||||
virtual unsigned int getError(){ return 0; };
|
||||
};
|
||||
|
||||
#endif
|
||||
305
tools/emulator/opengl/system/GLESv1_enc/gl_client_proc.h
Normal file
305
tools/emulator/opengl/system/GLESv1_enc/gl_client_proc.h
Normal file
@@ -0,0 +1,305 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __gl_client_proc_t_h
|
||||
#define __gl_client_proc_t_h
|
||||
|
||||
|
||||
|
||||
#include "gl_types.h"
|
||||
#ifndef gl_APIENTRY
|
||||
#define gl_APIENTRY
|
||||
#endif
|
||||
typedef void (gl_APIENTRY *glAlphaFunc_client_proc_t) (void * ctx, GLenum, GLclampf);
|
||||
typedef void (gl_APIENTRY *glClearColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
|
||||
typedef void (gl_APIENTRY *glClearDepthf_client_proc_t) (void * ctx, GLclampf);
|
||||
typedef void (gl_APIENTRY *glClipPlanef_client_proc_t) (void * ctx, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glColor4f_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glDepthRangef_client_proc_t) (void * ctx, GLclampf, GLclampf);
|
||||
typedef void (gl_APIENTRY *glFogf_client_proc_t) (void * ctx, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glFogfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glFrustumf_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glGetClipPlanef_client_proc_t) (void * ctx, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glGetFloatv_client_proc_t) (void * ctx, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glGetLightfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glGetMaterialfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glGetTexEnvfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glGetTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glLightModelf_client_proc_t) (void * ctx, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glLightModelfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glLightf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glLightfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glLineWidth_client_proc_t) (void * ctx, GLfloat);
|
||||
typedef void (gl_APIENTRY *glLoadMatrixf_client_proc_t) (void * ctx, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glMaterialf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glMaterialfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glMultMatrixf_client_proc_t) (void * ctx, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glMultiTexCoord4f_client_proc_t) (void * ctx, GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glNormal3f_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glOrthof_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glPointParameterf_client_proc_t) (void * ctx, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glPointParameterfv_client_proc_t) (void * ctx, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glPointSize_client_proc_t) (void * ctx, GLfloat);
|
||||
typedef void (gl_APIENTRY *glPolygonOffset_client_proc_t) (void * ctx, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glRotatef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glScalef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glTexEnvf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glTexEnvfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glTexParameterf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glTranslatef_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glActiveTexture_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glAlphaFuncx_client_proc_t) (void * ctx, GLenum, GLclampx);
|
||||
typedef void (gl_APIENTRY *glBindBuffer_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl_APIENTRY *glBindTexture_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl_APIENTRY *glBlendFunc_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef void (gl_APIENTRY *glBufferData_client_proc_t) (void * ctx, GLenum, GLsizeiptr, const GLvoid*, GLenum);
|
||||
typedef void (gl_APIENTRY *glBufferSubData_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glClear_client_proc_t) (void * ctx, GLbitfield);
|
||||
typedef void (gl_APIENTRY *glClearColorx_client_proc_t) (void * ctx, GLclampx, GLclampx, GLclampx, GLclampx);
|
||||
typedef void (gl_APIENTRY *glClearDepthx_client_proc_t) (void * ctx, GLclampx);
|
||||
typedef void (gl_APIENTRY *glClearStencil_client_proc_t) (void * ctx, GLint);
|
||||
typedef void (gl_APIENTRY *glClientActiveTexture_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glColor4ub_client_proc_t) (void * ctx, GLubyte, GLubyte, GLubyte, GLubyte);
|
||||
typedef void (gl_APIENTRY *glColor4x_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glColorMask_client_proc_t) (void * ctx, GLboolean, GLboolean, GLboolean, GLboolean);
|
||||
typedef void (gl_APIENTRY *glColorPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glCompressedTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glCompressedTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glCopyTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
|
||||
typedef void (gl_APIENTRY *glCopyTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
typedef void (gl_APIENTRY *glCullFace_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glDeleteBuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl_APIENTRY *glDeleteTextures_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl_APIENTRY *glDepthFunc_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glDepthMask_client_proc_t) (void * ctx, GLboolean);
|
||||
typedef void (gl_APIENTRY *glDepthRangex_client_proc_t) (void * ctx, GLclampx, GLclampx);
|
||||
typedef void (gl_APIENTRY *glDisable_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glDisableClientState_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glDrawArrays_client_proc_t) (void * ctx, GLenum, GLint, GLsizei);
|
||||
typedef void (gl_APIENTRY *glDrawElements_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glEnable_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glEnableClientState_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glFinish_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glFlush_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glFogx_client_proc_t) (void * ctx, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glFogxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glFrontFace_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glFrustumx_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glGetBooleanv_client_proc_t) (void * ctx, GLenum, GLboolean*);
|
||||
typedef void (gl_APIENTRY *glGetBufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glClipPlanex_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGenBuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl_APIENTRY *glGenTextures_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef GLenum (gl_APIENTRY *glGetError_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glGetFixedv_client_proc_t) (void * ctx, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetIntegerv_client_proc_t) (void * ctx, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glGetLightxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetMaterialxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetPointerv_client_proc_t) (void * ctx, GLenum, GLvoid**);
|
||||
typedef const GLubyte* (gl_APIENTRY *glGetString_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glGetTexEnviv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glGetTexEnvxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glGetTexParameterxv_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glHint_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef GLboolean (gl_APIENTRY *glIsBuffer_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl_APIENTRY *glIsEnabled_client_proc_t) (void * ctx, GLenum);
|
||||
typedef GLboolean (gl_APIENTRY *glIsTexture_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glLightModelx_client_proc_t) (void * ctx, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glLightModelxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glLightx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glLightxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glLineWidthx_client_proc_t) (void * ctx, GLfixed);
|
||||
typedef void (gl_APIENTRY *glLoadIdentity_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glLoadMatrixx_client_proc_t) (void * ctx, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glLogicOp_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glMaterialx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glMaterialxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glMatrixMode_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glMultMatrixx_client_proc_t) (void * ctx, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glMultiTexCoord4x_client_proc_t) (void * ctx, GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glNormal3x_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glNormalPointer_client_proc_t) (void * ctx, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glOrthox_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glPixelStorei_client_proc_t) (void * ctx, GLenum, GLint);
|
||||
typedef void (gl_APIENTRY *glPointParameterx_client_proc_t) (void * ctx, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glPointParameterxv_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glPointSizex_client_proc_t) (void * ctx, GLfixed);
|
||||
typedef void (gl_APIENTRY *glPolygonOffsetx_client_proc_t) (void * ctx, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glPopMatrix_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glPushMatrix_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glReadPixels_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
|
||||
typedef void (gl_APIENTRY *glRotatex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glSampleCoverage_client_proc_t) (void * ctx, GLclampf, GLboolean);
|
||||
typedef void (gl_APIENTRY *glSampleCoveragex_client_proc_t) (void * ctx, GLclampx, GLboolean);
|
||||
typedef void (gl_APIENTRY *glScalex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glScissor_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
|
||||
typedef void (gl_APIENTRY *glShadeModel_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glStencilFunc_client_proc_t) (void * ctx, GLenum, GLint, GLuint);
|
||||
typedef void (gl_APIENTRY *glStencilMask_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glStencilOp_client_proc_t) (void * ctx, GLenum, GLenum, GLenum);
|
||||
typedef void (gl_APIENTRY *glTexCoordPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glTexEnvi_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
|
||||
typedef void (gl_APIENTRY *glTexEnvx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glTexEnviv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
|
||||
typedef void (gl_APIENTRY *glTexEnvxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glTexParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
|
||||
typedef void (gl_APIENTRY *glTexParameterx_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
|
||||
typedef void (gl_APIENTRY *glTexParameterxv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glTranslatex_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glVertexPointer_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glViewport_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
|
||||
typedef void (gl_APIENTRY *glPointSizePointerOES_client_proc_t) (void * ctx, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glVertexPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
|
||||
typedef void (gl_APIENTRY *glColorPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
|
||||
typedef void (gl_APIENTRY *glNormalPointerOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLuint);
|
||||
typedef void (gl_APIENTRY *glPointSizePointerOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLuint);
|
||||
typedef void (gl_APIENTRY *glTexCoordPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
|
||||
typedef void (gl_APIENTRY *glWeightPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
|
||||
typedef void (gl_APIENTRY *glMatrixIndexPointerOffset_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, GLuint);
|
||||
typedef void (gl_APIENTRY *glVertexPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glColorPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glNormalPointerData_client_proc_t) (void * ctx, GLenum, GLsizei, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glTexCoordPointerData_client_proc_t) (void * ctx, GLint, GLint, GLenum, GLsizei, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glPointSizePointerData_client_proc_t) (void * ctx, GLenum, GLsizei, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glWeightPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glMatrixIndexPointerData_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glDrawElementsOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint);
|
||||
typedef void (gl_APIENTRY *glDrawElementsData_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, void*, GLuint);
|
||||
typedef void (gl_APIENTRY *glGetCompressedTextureFormats_client_proc_t) (void * ctx, int, GLint*);
|
||||
typedef int (gl_APIENTRY *glFinishRoundTrip_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glBlendEquationSeparateOES_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef void (gl_APIENTRY *glBlendFuncSeparateOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
|
||||
typedef void (gl_APIENTRY *glBlendEquationOES_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glDrawTexsOES_client_proc_t) (void * ctx, GLshort, GLshort, GLshort, GLshort, GLshort);
|
||||
typedef void (gl_APIENTRY *glDrawTexiOES_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint);
|
||||
typedef void (gl_APIENTRY *glDrawTexxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glDrawTexsvOES_client_proc_t) (void * ctx, const GLshort*);
|
||||
typedef void (gl_APIENTRY *glDrawTexivOES_client_proc_t) (void * ctx, const GLint*);
|
||||
typedef void (gl_APIENTRY *glDrawTexxvOES_client_proc_t) (void * ctx, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glDrawTexfOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glDrawTexfvOES_client_proc_t) (void * ctx, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glEGLImageTargetTexture2DOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
|
||||
typedef void (gl_APIENTRY *glEGLImageTargetRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
|
||||
typedef void (gl_APIENTRY *glAlphaFuncxOES_client_proc_t) (void * ctx, GLenum, GLclampx);
|
||||
typedef void (gl_APIENTRY *glClearColorxOES_client_proc_t) (void * ctx, GLclampx, GLclampx, GLclampx, GLclampx);
|
||||
typedef void (gl_APIENTRY *glClearDepthxOES_client_proc_t) (void * ctx, GLclampx);
|
||||
typedef void (gl_APIENTRY *glClipPlanexOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glClipPlanexIMG_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glColor4xOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glDepthRangexOES_client_proc_t) (void * ctx, GLclampx, GLclampx);
|
||||
typedef void (gl_APIENTRY *glFogxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glFogxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glFrustumxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glGetClipPlanexOES_client_proc_t) (void * ctx, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetClipPlanex_client_proc_t) (void * ctx, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetFixedvOES_client_proc_t) (void * ctx, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetLightxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetMaterialxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetTexEnvxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetTexParameterxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glLightModelxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glLightModelxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glLightxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glLightxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glLineWidthxOES_client_proc_t) (void * ctx, GLfixed);
|
||||
typedef void (gl_APIENTRY *glLoadMatrixxOES_client_proc_t) (void * ctx, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glMaterialxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glMaterialxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glMultMatrixxOES_client_proc_t) (void * ctx, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glMultiTexCoord4xOES_client_proc_t) (void * ctx, GLenum, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glNormal3xOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glOrthoxOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glPointParameterxOES_client_proc_t) (void * ctx, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glPointParameterxvOES_client_proc_t) (void * ctx, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glPointSizexOES_client_proc_t) (void * ctx, GLfixed);
|
||||
typedef void (gl_APIENTRY *glPolygonOffsetxOES_client_proc_t) (void * ctx, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glRotatexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glSampleCoveragexOES_client_proc_t) (void * ctx, GLclampx, GLboolean);
|
||||
typedef void (gl_APIENTRY *glScalexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
|
||||
typedef void (gl_APIENTRY *glTexEnvxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glTexEnvxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glTexParameterxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glTexParameterxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glTranslatexOES_client_proc_t) (void * ctx, GLfixed, GLfixed, GLfixed);
|
||||
typedef GLboolean (gl_APIENTRY *glIsRenderbufferOES_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glBindRenderbufferOES_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl_APIENTRY *glDeleteRenderbuffersOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl_APIENTRY *glGenRenderbuffersOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl_APIENTRY *glRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLenum, GLsizei, GLsizei);
|
||||
typedef void (gl_APIENTRY *glGetRenderbufferParameterivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef GLboolean (gl_APIENTRY *glIsFramebufferOES_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glBindFramebufferOES_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl_APIENTRY *glDeleteFramebuffersOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl_APIENTRY *glGenFramebuffersOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef GLenum (gl_APIENTRY *glCheckFramebufferStatusOES_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glFramebufferRenderbufferOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint);
|
||||
typedef void (gl_APIENTRY *glFramebufferTexture2DOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
typedef void (gl_APIENTRY *glGetFramebufferAttachmentParameterivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glGenerateMipmapOES_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void* (gl_APIENTRY *glMapBufferOES_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef GLboolean (gl_APIENTRY *glUnmapBufferOES_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl_APIENTRY *glGetBufferPointervOES_client_proc_t) (void * ctx, GLenum, GLenum, GLvoid**);
|
||||
typedef void (gl_APIENTRY *glCurrentPaletteMatrixOES_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glLoadPaletteFromModelViewMatrixOES_client_proc_t) (void * ctx);
|
||||
typedef void (gl_APIENTRY *glMatrixIndexPointerOES_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl_APIENTRY *glWeightPointerOES_client_proc_t) (void * ctx, GLint, GLenum, GLsizei, const GLvoid*);
|
||||
typedef GLbitfield (gl_APIENTRY *glQueryMatrixxOES_client_proc_t) (void * ctx, GLfixed*, GLint*);
|
||||
typedef void (gl_APIENTRY *glDepthRangefOES_client_proc_t) (void * ctx, GLclampf, GLclampf);
|
||||
typedef void (gl_APIENTRY *glFrustumfOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glOrthofOES_client_proc_t) (void * ctx, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl_APIENTRY *glClipPlanefOES_client_proc_t) (void * ctx, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glClipPlanefIMG_client_proc_t) (void * ctx, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glGetClipPlanefOES_client_proc_t) (void * ctx, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glClearDepthfOES_client_proc_t) (void * ctx, GLclampf);
|
||||
typedef void (gl_APIENTRY *glTexGenfOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
|
||||
typedef void (gl_APIENTRY *glTexGenfvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
|
||||
typedef void (gl_APIENTRY *glTexGeniOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
|
||||
typedef void (gl_APIENTRY *glTexGenivOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
|
||||
typedef void (gl_APIENTRY *glTexGenxOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed);
|
||||
typedef void (gl_APIENTRY *glTexGenxvOES_client_proc_t) (void * ctx, GLenum, GLenum, const GLfixed*);
|
||||
typedef void (gl_APIENTRY *glGetTexGenfvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
|
||||
typedef void (gl_APIENTRY *glGetTexGenivOES_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glGetTexGenxvOES_client_proc_t) (void * ctx, GLenum, GLenum, GLfixed*);
|
||||
typedef void (gl_APIENTRY *glBindVertexArrayOES_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glDeleteVertexArraysOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl_APIENTRY *glGenVertexArraysOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef GLboolean (gl_APIENTRY *glIsVertexArrayOES_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glDiscardFramebufferEXT_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
|
||||
typedef void (gl_APIENTRY *glMultiDrawArraysEXT_client_proc_t) (void * ctx, GLenum, GLint*, GLsizei*, GLsizei);
|
||||
typedef void (gl_APIENTRY *glMultiDrawElementsEXT_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei);
|
||||
typedef void (gl_APIENTRY *glMultiDrawArraysSUN_client_proc_t) (void * ctx, GLenum, GLint*, GLsizei*, GLsizei);
|
||||
typedef void (gl_APIENTRY *glMultiDrawElementsSUN_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei);
|
||||
typedef void (gl_APIENTRY *glRenderbufferStorageMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
typedef void (gl_APIENTRY *glFramebufferTexture2DMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
|
||||
typedef void (gl_APIENTRY *glDeleteFencesNV_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl_APIENTRY *glGenFencesNV_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef GLboolean (gl_APIENTRY *glIsFenceNV_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl_APIENTRY *glTestFenceNV_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glGetFenceivNV_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glFinishFenceNV_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glSetFenceNV_client_proc_t) (void * ctx, GLuint, GLenum);
|
||||
typedef void (gl_APIENTRY *glGetDriverControlsQCOM_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
|
||||
typedef void (gl_APIENTRY *glGetDriverControlStringQCOM_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
|
||||
typedef void (gl_APIENTRY *glEnableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glDisableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glExtGetTexturesQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl_APIENTRY *glExtGetBuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl_APIENTRY *glExtGetRenderbuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl_APIENTRY *glExtGetFramebuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl_APIENTRY *glExtGetTexLevelParameterivQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLint, GLenum, GLint*);
|
||||
typedef void (gl_APIENTRY *glExtTexObjectStateOverrideiQCOM_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
|
||||
typedef void (gl_APIENTRY *glExtGetTexSubImageQCOM_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
|
||||
typedef void (gl_APIENTRY *glExtGetBufferPointervQCOM_client_proc_t) (void * ctx, GLenum, GLvoid**);
|
||||
typedef void (gl_APIENTRY *glExtGetShadersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl_APIENTRY *glExtGetProgramsQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef GLboolean (gl_APIENTRY *glExtIsProgramBinaryQCOM_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl_APIENTRY *glExtGetProgramBinarySourceQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLchar*, GLint*);
|
||||
typedef void (gl_APIENTRY *glStartTilingQCOM_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLbitfield);
|
||||
typedef void (gl_APIENTRY *glEndTilingQCOM_client_proc_t) (void * ctx, GLbitfield);
|
||||
|
||||
|
||||
#endif
|
||||
5184
tools/emulator/opengl/system/GLESv1_enc/gl_enc.cpp
Normal file
5184
tools/emulator/opengl/system/GLESv1_enc/gl_enc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
316
tools/emulator/opengl/system/GLESv1_enc/gl_enc.h
Normal file
316
tools/emulator/opengl/system/GLESv1_enc/gl_enc.h
Normal file
@@ -0,0 +1,316 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
#ifndef GUARD_gl_encoder_context_t
|
||||
#define GUARD_gl_encoder_context_t
|
||||
|
||||
#include "IOStream.h"
|
||||
#include "gl_client_context.h"
|
||||
|
||||
|
||||
#include "glUtils.h"
|
||||
#include "GLEncoderUtils.h"
|
||||
|
||||
struct gl_encoder_context_t : public gl_client_context_t {
|
||||
|
||||
IOStream *m_stream;
|
||||
|
||||
gl_encoder_context_t(IOStream *stream);
|
||||
|
||||
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
void glAlphaFunc_enc(void *self , GLenum func, GLclampf ref);
|
||||
void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void glClearDepthf_enc(void *self , GLclampf depth);
|
||||
void glClipPlanef_enc(void *self , GLenum plane, const GLfloat* equation);
|
||||
void glColor4f_enc(void *self , GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar);
|
||||
void glFogf_enc(void *self , GLenum pname, GLfloat param);
|
||||
void glFogfv_enc(void *self , GLenum pname, const GLfloat* params);
|
||||
void glFrustumf_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
|
||||
void glGetClipPlanef_enc(void *self , GLenum pname, GLfloat* eqn);
|
||||
void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params);
|
||||
void glGetLightfv_enc(void *self , GLenum light, GLenum pname, GLfloat* params);
|
||||
void glGetMaterialfv_enc(void *self , GLenum face, GLenum pname, GLfloat* params);
|
||||
void glGetTexEnvfv_enc(void *self , GLenum env, GLenum pname, GLfloat* params);
|
||||
void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params);
|
||||
void glLightModelf_enc(void *self , GLenum pname, GLfloat param);
|
||||
void glLightModelfv_enc(void *self , GLenum pname, const GLfloat* params);
|
||||
void glLightf_enc(void *self , GLenum light, GLenum pname, GLfloat param);
|
||||
void glLightfv_enc(void *self , GLenum light, GLenum pname, const GLfloat* params);
|
||||
void glLineWidth_enc(void *self , GLfloat width);
|
||||
void glLoadMatrixf_enc(void *self , const GLfloat* m);
|
||||
void glMaterialf_enc(void *self , GLenum face, GLenum pname, GLfloat param);
|
||||
void glMaterialfv_enc(void *self , GLenum face, GLenum pname, const GLfloat* params);
|
||||
void glMultMatrixf_enc(void *self , const GLfloat* m);
|
||||
void glMultiTexCoord4f_enc(void *self , GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glNormal3f_enc(void *self , GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
void glOrthof_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
|
||||
void glPointParameterf_enc(void *self , GLenum pname, GLfloat param);
|
||||
void glPointParameterfv_enc(void *self , GLenum pname, const GLfloat* params);
|
||||
void glPointSize_enc(void *self , GLfloat size);
|
||||
void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units);
|
||||
void glRotatef_enc(void *self , GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glScalef_enc(void *self , GLfloat x, GLfloat y, GLfloat z);
|
||||
void glTexEnvf_enc(void *self , GLenum target, GLenum pname, GLfloat param);
|
||||
void glTexEnvfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params);
|
||||
void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param);
|
||||
void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params);
|
||||
void glTranslatef_enc(void *self , GLfloat x, GLfloat y, GLfloat z);
|
||||
void glActiveTexture_enc(void *self , GLenum texture);
|
||||
void glAlphaFuncx_enc(void *self , GLenum func, GLclampx ref);
|
||||
void glBindBuffer_enc(void *self , GLenum target, GLuint buffer);
|
||||
void glBindTexture_enc(void *self , GLenum target, GLuint texture);
|
||||
void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor);
|
||||
void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
|
||||
void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
|
||||
void glClear_enc(void *self , GLbitfield mask);
|
||||
void glClearColorx_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
|
||||
void glClearDepthx_enc(void *self , GLclampx depth);
|
||||
void glClearStencil_enc(void *self , GLint s);
|
||||
void glClientActiveTexture_enc(void *self , GLenum texture);
|
||||
void glColor4ub_enc(void *self , GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
void glColor4x_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
void glColorPointer_enc(void *self , GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
|
||||
void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
|
||||
void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glCullFace_enc(void *self , GLenum mode);
|
||||
void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers);
|
||||
void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures);
|
||||
void glDepthFunc_enc(void *self , GLenum func);
|
||||
void glDepthMask_enc(void *self , GLboolean flag);
|
||||
void glDepthRangex_enc(void *self , GLclampx zNear, GLclampx zFar);
|
||||
void glDisable_enc(void *self , GLenum cap);
|
||||
void glDisableClientState_enc(void *self , GLenum array);
|
||||
void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count);
|
||||
void glDrawElements_enc(void *self , GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
|
||||
void glEnable_enc(void *self , GLenum cap);
|
||||
void glEnableClientState_enc(void *self , GLenum array);
|
||||
void glFinish_enc(void *self );
|
||||
void glFlush_enc(void *self );
|
||||
void glFogx_enc(void *self , GLenum pname, GLfixed param);
|
||||
void glFogxv_enc(void *self , GLenum pname, const GLfixed* params);
|
||||
void glFrontFace_enc(void *self , GLenum mode);
|
||||
void glFrustumx_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
|
||||
void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params);
|
||||
void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params);
|
||||
void glClipPlanex_enc(void *self , GLenum pname, const GLfixed* eqn);
|
||||
void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers);
|
||||
void glGenTextures_enc(void *self , GLsizei n, GLuint* textures);
|
||||
GLenum glGetError_enc(void *self );
|
||||
void glGetFixedv_enc(void *self , GLenum pname, GLfixed* params);
|
||||
void glGetIntegerv_enc(void *self , GLenum pname, GLint* params);
|
||||
void glGetLightxv_enc(void *self , GLenum light, GLenum pname, GLfixed* params);
|
||||
void glGetMaterialxv_enc(void *self , GLenum face, GLenum pname, GLfixed* params);
|
||||
void glGetPointerv_enc(void *self , GLenum pname, GLvoid** params);
|
||||
const GLubyte* glGetString_enc(void *self , GLenum name);
|
||||
void glGetTexEnviv_enc(void *self , GLenum env, GLenum pname, GLint* params);
|
||||
void glGetTexEnvxv_enc(void *self , GLenum env, GLenum pname, GLfixed* params);
|
||||
void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params);
|
||||
void glGetTexParameterxv_enc(void *self , GLenum target, GLenum pname, GLfixed* params);
|
||||
void glHint_enc(void *self , GLenum target, GLenum mode);
|
||||
GLboolean glIsBuffer_enc(void *self , GLuint buffer);
|
||||
GLboolean glIsEnabled_enc(void *self , GLenum cap);
|
||||
GLboolean glIsTexture_enc(void *self , GLuint texture);
|
||||
void glLightModelx_enc(void *self , GLenum pname, GLfixed param);
|
||||
void glLightModelxv_enc(void *self , GLenum pname, const GLfixed* params);
|
||||
void glLightx_enc(void *self , GLenum light, GLenum pname, GLfixed param);
|
||||
void glLightxv_enc(void *self , GLenum light, GLenum pname, const GLfixed* params);
|
||||
void glLineWidthx_enc(void *self , GLfixed width);
|
||||
void glLoadIdentity_enc(void *self );
|
||||
void glLoadMatrixx_enc(void *self , const GLfixed* m);
|
||||
void glLogicOp_enc(void *self , GLenum opcode);
|
||||
void glMaterialx_enc(void *self , GLenum face, GLenum pname, GLfixed param);
|
||||
void glMaterialxv_enc(void *self , GLenum face, GLenum pname, const GLfixed* params);
|
||||
void glMatrixMode_enc(void *self , GLenum mode);
|
||||
void glMultMatrixx_enc(void *self , const GLfixed* m);
|
||||
void glMultiTexCoord4x_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
|
||||
void glNormal3x_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz);
|
||||
void glNormalPointer_enc(void *self , GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void glOrthox_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
|
||||
void glPixelStorei_enc(void *self , GLenum pname, GLint param);
|
||||
void glPointParameterx_enc(void *self , GLenum pname, GLfixed param);
|
||||
void glPointParameterxv_enc(void *self , GLenum pname, const GLfixed* params);
|
||||
void glPointSizex_enc(void *self , GLfixed size);
|
||||
void glPolygonOffsetx_enc(void *self , GLfixed factor, GLfixed units);
|
||||
void glPopMatrix_enc(void *self );
|
||||
void glPushMatrix_enc(void *self );
|
||||
void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
||||
void glRotatex_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
|
||||
void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert);
|
||||
void glSampleCoveragex_enc(void *self , GLclampx value, GLboolean invert);
|
||||
void glScalex_enc(void *self , GLfixed x, GLfixed y, GLfixed z);
|
||||
void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glShadeModel_enc(void *self , GLenum mode);
|
||||
void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask);
|
||||
void glStencilMask_enc(void *self , GLuint mask);
|
||||
void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass);
|
||||
void glTexCoordPointer_enc(void *self , GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void glTexEnvi_enc(void *self , GLenum target, GLenum pname, GLint param);
|
||||
void glTexEnvx_enc(void *self , GLenum target, GLenum pname, GLfixed param);
|
||||
void glTexEnviv_enc(void *self , GLenum target, GLenum pname, const GLint* params);
|
||||
void glTexEnvxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params);
|
||||
void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param);
|
||||
void glTexParameterx_enc(void *self , GLenum target, GLenum pname, GLfixed param);
|
||||
void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params);
|
||||
void glTexParameterxv_enc(void *self , GLenum target, GLenum pname, const GLfixed* params);
|
||||
void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void glTranslatex_enc(void *self , GLfixed x, GLfixed y, GLfixed z);
|
||||
void glVertexPointer_enc(void *self , GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glPointSizePointerOES_enc(void *self , GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void glVertexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset);
|
||||
void glColorPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset);
|
||||
void glNormalPointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset);
|
||||
void glPointSizePointerOffset_enc(void *self , GLenum type, GLsizei stride, GLuint offset);
|
||||
void glTexCoordPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset);
|
||||
void glWeightPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset);
|
||||
void glMatrixIndexPointerOffset_enc(void *self , GLint size, GLenum type, GLsizei stride, GLuint offset);
|
||||
void glVertexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
|
||||
void glColorPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
|
||||
void glNormalPointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen);
|
||||
void glTexCoordPointerData_enc(void *self , GLint unit, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
|
||||
void glPointSizePointerData_enc(void *self , GLenum type, GLsizei stride, void* data, GLuint datalen);
|
||||
void glWeightPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
|
||||
void glMatrixIndexPointerData_enc(void *self , GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
|
||||
void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset);
|
||||
void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
|
||||
void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats);
|
||||
int glFinishRoundTrip_enc(void *self );
|
||||
void glBlendEquationSeparateOES_enc(void *self , GLenum modeRGB, GLenum modeAlpha);
|
||||
void glBlendFuncSeparateOES_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glBlendEquationOES_enc(void *self , GLenum mode);
|
||||
void glDrawTexsOES_enc(void *self , GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
|
||||
void glDrawTexiOES_enc(void *self , GLint x, GLint y, GLint z, GLint width, GLint height);
|
||||
void glDrawTexxOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
|
||||
void glDrawTexsvOES_enc(void *self , const GLshort* coords);
|
||||
void glDrawTexivOES_enc(void *self , const GLint* coords);
|
||||
void glDrawTexxvOES_enc(void *self , const GLfixed* coords);
|
||||
void glDrawTexfOES_enc(void *self , GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
|
||||
void glDrawTexfvOES_enc(void *self , const GLfloat* coords);
|
||||
void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image);
|
||||
void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image);
|
||||
void glAlphaFuncxOES_enc(void *self , GLenum func, GLclampx ref);
|
||||
void glClearColorxOES_enc(void *self , GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
|
||||
void glClearDepthxOES_enc(void *self , GLclampx depth);
|
||||
void glClipPlanexOES_enc(void *self , GLenum plane, const GLfixed* equation);
|
||||
void glClipPlanexIMG_enc(void *self , GLenum plane, const GLfixed* equation);
|
||||
void glColor4xOES_enc(void *self , GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
void glDepthRangexOES_enc(void *self , GLclampx zNear, GLclampx zFar);
|
||||
void glFogxOES_enc(void *self , GLenum pname, GLfixed param);
|
||||
void glFogxvOES_enc(void *self , GLenum pname, const GLfixed* params);
|
||||
void glFrustumxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
|
||||
void glGetClipPlanexOES_enc(void *self , GLenum pname, GLfixed* eqn);
|
||||
void glGetClipPlanex_enc(void *self , GLenum pname, GLfixed* eqn);
|
||||
void glGetFixedvOES_enc(void *self , GLenum pname, GLfixed* params);
|
||||
void glGetLightxvOES_enc(void *self , GLenum light, GLenum pname, GLfixed* params);
|
||||
void glGetMaterialxvOES_enc(void *self , GLenum face, GLenum pname, GLfixed* params);
|
||||
void glGetTexEnvxvOES_enc(void *self , GLenum env, GLenum pname, GLfixed* params);
|
||||
void glGetTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, GLfixed* params);
|
||||
void glLightModelxOES_enc(void *self , GLenum pname, GLfixed param);
|
||||
void glLightModelxvOES_enc(void *self , GLenum pname, const GLfixed* params);
|
||||
void glLightxOES_enc(void *self , GLenum light, GLenum pname, GLfixed param);
|
||||
void glLightxvOES_enc(void *self , GLenum light, GLenum pname, const GLfixed* params);
|
||||
void glLineWidthxOES_enc(void *self , GLfixed width);
|
||||
void glLoadMatrixxOES_enc(void *self , const GLfixed* m);
|
||||
void glMaterialxOES_enc(void *self , GLenum face, GLenum pname, GLfixed param);
|
||||
void glMaterialxvOES_enc(void *self , GLenum face, GLenum pname, const GLfixed* params);
|
||||
void glMultMatrixxOES_enc(void *self , const GLfixed* m);
|
||||
void glMultiTexCoord4xOES_enc(void *self , GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
|
||||
void glNormal3xOES_enc(void *self , GLfixed nx, GLfixed ny, GLfixed nz);
|
||||
void glOrthoxOES_enc(void *self , GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
|
||||
void glPointParameterxOES_enc(void *self , GLenum pname, GLfixed param);
|
||||
void glPointParameterxvOES_enc(void *self , GLenum pname, const GLfixed* params);
|
||||
void glPointSizexOES_enc(void *self , GLfixed size);
|
||||
void glPolygonOffsetxOES_enc(void *self , GLfixed factor, GLfixed units);
|
||||
void glRotatexOES_enc(void *self , GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
|
||||
void glSampleCoveragexOES_enc(void *self , GLclampx value, GLboolean invert);
|
||||
void glScalexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z);
|
||||
void glTexEnvxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param);
|
||||
void glTexEnvxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params);
|
||||
void glTexParameterxOES_enc(void *self , GLenum target, GLenum pname, GLfixed param);
|
||||
void glTexParameterxvOES_enc(void *self , GLenum target, GLenum pname, const GLfixed* params);
|
||||
void glTranslatexOES_enc(void *self , GLfixed x, GLfixed y, GLfixed z);
|
||||
GLboolean glIsRenderbufferOES_enc(void *self , GLuint renderbuffer);
|
||||
void glBindRenderbufferOES_enc(void *self , GLenum target, GLuint renderbuffer);
|
||||
void glDeleteRenderbuffersOES_enc(void *self , GLsizei n, const GLuint* renderbuffers);
|
||||
void glGenRenderbuffersOES_enc(void *self , GLsizei n, GLuint* renderbuffers);
|
||||
void glRenderbufferStorageOES_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glGetRenderbufferParameterivOES_enc(void *self , GLenum target, GLenum pname, GLint* params);
|
||||
GLboolean glIsFramebufferOES_enc(void *self , GLuint framebuffer);
|
||||
void glBindFramebufferOES_enc(void *self , GLenum target, GLuint framebuffer);
|
||||
void glDeleteFramebuffersOES_enc(void *self , GLsizei n, const GLuint* framebuffers);
|
||||
void glGenFramebuffersOES_enc(void *self , GLsizei n, GLuint* framebuffers);
|
||||
GLenum glCheckFramebufferStatusOES_enc(void *self , GLenum target);
|
||||
void glFramebufferRenderbufferOES_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
void glFramebufferTexture2DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
void glGetFramebufferAttachmentParameterivOES_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params);
|
||||
void glGenerateMipmapOES_enc(void *self , GLenum target);
|
||||
void* glMapBufferOES_enc(void *self , GLenum target, GLenum access);
|
||||
GLboolean glUnmapBufferOES_enc(void *self , GLenum target);
|
||||
void glGetBufferPointervOES_enc(void *self , GLenum target, GLenum pname, GLvoid** params);
|
||||
void glCurrentPaletteMatrixOES_enc(void *self , GLuint matrixpaletteindex);
|
||||
void glLoadPaletteFromModelViewMatrixOES_enc(void *self );
|
||||
void glMatrixIndexPointerOES_enc(void *self , GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
void glWeightPointerOES_enc(void *self , GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
|
||||
GLbitfield glQueryMatrixxOES_enc(void *self , GLfixed* mantissa, GLint* exponent);
|
||||
void glDepthRangefOES_enc(void *self , GLclampf zNear, GLclampf zFar);
|
||||
void glFrustumfOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
|
||||
void glOrthofOES_enc(void *self , GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
|
||||
void glClipPlanefOES_enc(void *self , GLenum plane, const GLfloat* equation);
|
||||
void glClipPlanefIMG_enc(void *self , GLenum plane, const GLfloat* equation);
|
||||
void glGetClipPlanefOES_enc(void *self , GLenum pname, GLfloat* eqn);
|
||||
void glClearDepthfOES_enc(void *self , GLclampf depth);
|
||||
void glTexGenfOES_enc(void *self , GLenum coord, GLenum pname, GLfloat param);
|
||||
void glTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, const GLfloat* params);
|
||||
void glTexGeniOES_enc(void *self , GLenum coord, GLenum pname, GLint param);
|
||||
void glTexGenivOES_enc(void *self , GLenum coord, GLenum pname, const GLint* params);
|
||||
void glTexGenxOES_enc(void *self , GLenum coord, GLenum pname, GLfixed param);
|
||||
void glTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, const GLfixed* params);
|
||||
void glGetTexGenfvOES_enc(void *self , GLenum coord, GLenum pname, GLfloat* params);
|
||||
void glGetTexGenivOES_enc(void *self , GLenum coord, GLenum pname, GLint* params);
|
||||
void glGetTexGenxvOES_enc(void *self , GLenum coord, GLenum pname, GLfixed* params);
|
||||
void glBindVertexArrayOES_enc(void *self , GLuint array);
|
||||
void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays);
|
||||
void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays);
|
||||
GLboolean glIsVertexArrayOES_enc(void *self , GLuint array);
|
||||
void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments);
|
||||
void glMultiDrawArraysEXT_enc(void *self , GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
|
||||
void glMultiDrawElementsEXT_enc(void *self , GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
|
||||
void glMultiDrawArraysSUN_enc(void *self , GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
|
||||
void glMultiDrawElementsSUN_enc(void *self , GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
|
||||
void glRenderbufferStorageMultisampleIMG_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glFramebufferTexture2DMultisampleIMG_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
void glDeleteFencesNV_enc(void *self , GLsizei n, const GLuint* fences);
|
||||
void glGenFencesNV_enc(void *self , GLsizei n, GLuint* fences);
|
||||
GLboolean glIsFenceNV_enc(void *self , GLuint fence);
|
||||
GLboolean glTestFenceNV_enc(void *self , GLuint fence);
|
||||
void glGetFenceivNV_enc(void *self , GLuint fence, GLenum pname, GLint* params);
|
||||
void glFinishFenceNV_enc(void *self , GLuint fence);
|
||||
void glSetFenceNV_enc(void *self , GLuint fence, GLenum condition);
|
||||
void glGetDriverControlsQCOM_enc(void *self , GLint* num, GLsizei size, GLuint* driverControls);
|
||||
void glGetDriverControlStringQCOM_enc(void *self , GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString);
|
||||
void glEnableDriverControlQCOM_enc(void *self , GLuint driverControl);
|
||||
void glDisableDriverControlQCOM_enc(void *self , GLuint driverControl);
|
||||
void glExtGetTexturesQCOM_enc(void *self , GLuint* textures, GLint maxTextures, GLint* numTextures);
|
||||
void glExtGetBuffersQCOM_enc(void *self , GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
|
||||
void glExtGetRenderbuffersQCOM_enc(void *self , GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
|
||||
void glExtGetFramebuffersQCOM_enc(void *self , GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
|
||||
void glExtGetTexLevelParameterivQCOM_enc(void *self , GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
|
||||
void glExtTexObjectStateOverrideiQCOM_enc(void *self , GLenum target, GLenum pname, GLint param);
|
||||
void glExtGetTexSubImageQCOM_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels);
|
||||
void glExtGetBufferPointervQCOM_enc(void *self , GLenum target, GLvoid** params);
|
||||
void glExtGetShadersQCOM_enc(void *self , GLuint* shaders, GLint maxShaders, GLint* numShaders);
|
||||
void glExtGetProgramsQCOM_enc(void *self , GLuint* programs, GLint maxPrograms, GLint* numPrograms);
|
||||
GLboolean glExtIsProgramBinaryQCOM_enc(void *self , GLuint program);
|
||||
void glExtGetProgramBinarySourceQCOM_enc(void *self , GLuint program, GLenum shadertype, GLchar* source, GLint* length);
|
||||
void glStartTilingQCOM_enc(void *self , GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
|
||||
void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask);
|
||||
};
|
||||
#endif
|
||||
2066
tools/emulator/opengl/system/GLESv1_enc/gl_entry.cpp
Normal file
2066
tools/emulator/opengl/system/GLESv1_enc/gl_entry.cpp
Normal file
File diff suppressed because it is too large
Load Diff
288
tools/emulator/opengl/system/GLESv1_enc/gl_ftable.h
Normal file
288
tools/emulator/opengl/system/GLESv1_enc/gl_ftable.h
Normal file
@@ -0,0 +1,288 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __gl_client_ftable_t_h
|
||||
#define __gl_client_ftable_t_h
|
||||
|
||||
|
||||
static struct _gl_funcs_by_name {
|
||||
const char *name;
|
||||
void *proc;
|
||||
} gl_funcs_by_name[] = {
|
||||
{"glAlphaFunc", (void*)glAlphaFunc},
|
||||
{"glClearColor", (void*)glClearColor},
|
||||
{"glClearDepthf", (void*)glClearDepthf},
|
||||
{"glClipPlanef", (void*)glClipPlanef},
|
||||
{"glColor4f", (void*)glColor4f},
|
||||
{"glDepthRangef", (void*)glDepthRangef},
|
||||
{"glFogf", (void*)glFogf},
|
||||
{"glFogfv", (void*)glFogfv},
|
||||
{"glFrustumf", (void*)glFrustumf},
|
||||
{"glGetClipPlanef", (void*)glGetClipPlanef},
|
||||
{"glGetFloatv", (void*)glGetFloatv},
|
||||
{"glGetLightfv", (void*)glGetLightfv},
|
||||
{"glGetMaterialfv", (void*)glGetMaterialfv},
|
||||
{"glGetTexEnvfv", (void*)glGetTexEnvfv},
|
||||
{"glGetTexParameterfv", (void*)glGetTexParameterfv},
|
||||
{"glLightModelf", (void*)glLightModelf},
|
||||
{"glLightModelfv", (void*)glLightModelfv},
|
||||
{"glLightf", (void*)glLightf},
|
||||
{"glLightfv", (void*)glLightfv},
|
||||
{"glLineWidth", (void*)glLineWidth},
|
||||
{"glLoadMatrixf", (void*)glLoadMatrixf},
|
||||
{"glMaterialf", (void*)glMaterialf},
|
||||
{"glMaterialfv", (void*)glMaterialfv},
|
||||
{"glMultMatrixf", (void*)glMultMatrixf},
|
||||
{"glMultiTexCoord4f", (void*)glMultiTexCoord4f},
|
||||
{"glNormal3f", (void*)glNormal3f},
|
||||
{"glOrthof", (void*)glOrthof},
|
||||
{"glPointParameterf", (void*)glPointParameterf},
|
||||
{"glPointParameterfv", (void*)glPointParameterfv},
|
||||
{"glPointSize", (void*)glPointSize},
|
||||
{"glPolygonOffset", (void*)glPolygonOffset},
|
||||
{"glRotatef", (void*)glRotatef},
|
||||
{"glScalef", (void*)glScalef},
|
||||
{"glTexEnvf", (void*)glTexEnvf},
|
||||
{"glTexEnvfv", (void*)glTexEnvfv},
|
||||
{"glTexParameterf", (void*)glTexParameterf},
|
||||
{"glTexParameterfv", (void*)glTexParameterfv},
|
||||
{"glTranslatef", (void*)glTranslatef},
|
||||
{"glActiveTexture", (void*)glActiveTexture},
|
||||
{"glAlphaFuncx", (void*)glAlphaFuncx},
|
||||
{"glBindBuffer", (void*)glBindBuffer},
|
||||
{"glBindTexture", (void*)glBindTexture},
|
||||
{"glBlendFunc", (void*)glBlendFunc},
|
||||
{"glBufferData", (void*)glBufferData},
|
||||
{"glBufferSubData", (void*)glBufferSubData},
|
||||
{"glClear", (void*)glClear},
|
||||
{"glClearColorx", (void*)glClearColorx},
|
||||
{"glClearDepthx", (void*)glClearDepthx},
|
||||
{"glClearStencil", (void*)glClearStencil},
|
||||
{"glClientActiveTexture", (void*)glClientActiveTexture},
|
||||
{"glColor4ub", (void*)glColor4ub},
|
||||
{"glColor4x", (void*)glColor4x},
|
||||
{"glColorMask", (void*)glColorMask},
|
||||
{"glColorPointer", (void*)glColorPointer},
|
||||
{"glCompressedTexImage2D", (void*)glCompressedTexImage2D},
|
||||
{"glCompressedTexSubImage2D", (void*)glCompressedTexSubImage2D},
|
||||
{"glCopyTexImage2D", (void*)glCopyTexImage2D},
|
||||
{"glCopyTexSubImage2D", (void*)glCopyTexSubImage2D},
|
||||
{"glCullFace", (void*)glCullFace},
|
||||
{"glDeleteBuffers", (void*)glDeleteBuffers},
|
||||
{"glDeleteTextures", (void*)glDeleteTextures},
|
||||
{"glDepthFunc", (void*)glDepthFunc},
|
||||
{"glDepthMask", (void*)glDepthMask},
|
||||
{"glDepthRangex", (void*)glDepthRangex},
|
||||
{"glDisable", (void*)glDisable},
|
||||
{"glDisableClientState", (void*)glDisableClientState},
|
||||
{"glDrawArrays", (void*)glDrawArrays},
|
||||
{"glDrawElements", (void*)glDrawElements},
|
||||
{"glEnable", (void*)glEnable},
|
||||
{"glEnableClientState", (void*)glEnableClientState},
|
||||
{"glFinish", (void*)glFinish},
|
||||
{"glFlush", (void*)glFlush},
|
||||
{"glFogx", (void*)glFogx},
|
||||
{"glFogxv", (void*)glFogxv},
|
||||
{"glFrontFace", (void*)glFrontFace},
|
||||
{"glFrustumx", (void*)glFrustumx},
|
||||
{"glGetBooleanv", (void*)glGetBooleanv},
|
||||
{"glGetBufferParameteriv", (void*)glGetBufferParameteriv},
|
||||
{"glClipPlanex", (void*)glClipPlanex},
|
||||
{"glGenBuffers", (void*)glGenBuffers},
|
||||
{"glGenTextures", (void*)glGenTextures},
|
||||
{"glGetError", (void*)glGetError},
|
||||
{"glGetFixedv", (void*)glGetFixedv},
|
||||
{"glGetIntegerv", (void*)glGetIntegerv},
|
||||
{"glGetLightxv", (void*)glGetLightxv},
|
||||
{"glGetMaterialxv", (void*)glGetMaterialxv},
|
||||
{"glGetPointerv", (void*)glGetPointerv},
|
||||
{"glGetString", (void*)glGetString},
|
||||
{"glGetTexEnviv", (void*)glGetTexEnviv},
|
||||
{"glGetTexEnvxv", (void*)glGetTexEnvxv},
|
||||
{"glGetTexParameteriv", (void*)glGetTexParameteriv},
|
||||
{"glGetTexParameterxv", (void*)glGetTexParameterxv},
|
||||
{"glHint", (void*)glHint},
|
||||
{"glIsBuffer", (void*)glIsBuffer},
|
||||
{"glIsEnabled", (void*)glIsEnabled},
|
||||
{"glIsTexture", (void*)glIsTexture},
|
||||
{"glLightModelx", (void*)glLightModelx},
|
||||
{"glLightModelxv", (void*)glLightModelxv},
|
||||
{"glLightx", (void*)glLightx},
|
||||
{"glLightxv", (void*)glLightxv},
|
||||
{"glLineWidthx", (void*)glLineWidthx},
|
||||
{"glLoadIdentity", (void*)glLoadIdentity},
|
||||
{"glLoadMatrixx", (void*)glLoadMatrixx},
|
||||
{"glLogicOp", (void*)glLogicOp},
|
||||
{"glMaterialx", (void*)glMaterialx},
|
||||
{"glMaterialxv", (void*)glMaterialxv},
|
||||
{"glMatrixMode", (void*)glMatrixMode},
|
||||
{"glMultMatrixx", (void*)glMultMatrixx},
|
||||
{"glMultiTexCoord4x", (void*)glMultiTexCoord4x},
|
||||
{"glNormal3x", (void*)glNormal3x},
|
||||
{"glNormalPointer", (void*)glNormalPointer},
|
||||
{"glOrthox", (void*)glOrthox},
|
||||
{"glPixelStorei", (void*)glPixelStorei},
|
||||
{"glPointParameterx", (void*)glPointParameterx},
|
||||
{"glPointParameterxv", (void*)glPointParameterxv},
|
||||
{"glPointSizex", (void*)glPointSizex},
|
||||
{"glPolygonOffsetx", (void*)glPolygonOffsetx},
|
||||
{"glPopMatrix", (void*)glPopMatrix},
|
||||
{"glPushMatrix", (void*)glPushMatrix},
|
||||
{"glReadPixels", (void*)glReadPixels},
|
||||
{"glRotatex", (void*)glRotatex},
|
||||
{"glSampleCoverage", (void*)glSampleCoverage},
|
||||
{"glSampleCoveragex", (void*)glSampleCoveragex},
|
||||
{"glScalex", (void*)glScalex},
|
||||
{"glScissor", (void*)glScissor},
|
||||
{"glShadeModel", (void*)glShadeModel},
|
||||
{"glStencilFunc", (void*)glStencilFunc},
|
||||
{"glStencilMask", (void*)glStencilMask},
|
||||
{"glStencilOp", (void*)glStencilOp},
|
||||
{"glTexCoordPointer", (void*)glTexCoordPointer},
|
||||
{"glTexEnvi", (void*)glTexEnvi},
|
||||
{"glTexEnvx", (void*)glTexEnvx},
|
||||
{"glTexEnviv", (void*)glTexEnviv},
|
||||
{"glTexEnvxv", (void*)glTexEnvxv},
|
||||
{"glTexImage2D", (void*)glTexImage2D},
|
||||
{"glTexParameteri", (void*)glTexParameteri},
|
||||
{"glTexParameterx", (void*)glTexParameterx},
|
||||
{"glTexParameteriv", (void*)glTexParameteriv},
|
||||
{"glTexParameterxv", (void*)glTexParameterxv},
|
||||
{"glTexSubImage2D", (void*)glTexSubImage2D},
|
||||
{"glTranslatex", (void*)glTranslatex},
|
||||
{"glVertexPointer", (void*)glVertexPointer},
|
||||
{"glViewport", (void*)glViewport},
|
||||
{"glPointSizePointerOES", (void*)glPointSizePointerOES},
|
||||
{"glBlendEquationSeparateOES", (void*)glBlendEquationSeparateOES},
|
||||
{"glBlendFuncSeparateOES", (void*)glBlendFuncSeparateOES},
|
||||
{"glBlendEquationOES", (void*)glBlendEquationOES},
|
||||
{"glDrawTexsOES", (void*)glDrawTexsOES},
|
||||
{"glDrawTexiOES", (void*)glDrawTexiOES},
|
||||
{"glDrawTexxOES", (void*)glDrawTexxOES},
|
||||
{"glDrawTexsvOES", (void*)glDrawTexsvOES},
|
||||
{"glDrawTexivOES", (void*)glDrawTexivOES},
|
||||
{"glDrawTexxvOES", (void*)glDrawTexxvOES},
|
||||
{"glDrawTexfOES", (void*)glDrawTexfOES},
|
||||
{"glDrawTexfvOES", (void*)glDrawTexfvOES},
|
||||
{"glEGLImageTargetTexture2DOES", (void*)glEGLImageTargetTexture2DOES},
|
||||
{"glEGLImageTargetRenderbufferStorageOES", (void*)glEGLImageTargetRenderbufferStorageOES},
|
||||
{"glAlphaFuncxOES", (void*)glAlphaFuncxOES},
|
||||
{"glClearColorxOES", (void*)glClearColorxOES},
|
||||
{"glClearDepthxOES", (void*)glClearDepthxOES},
|
||||
{"glClipPlanexOES", (void*)glClipPlanexOES},
|
||||
{"glClipPlanexIMG", (void*)glClipPlanexIMG},
|
||||
{"glColor4xOES", (void*)glColor4xOES},
|
||||
{"glDepthRangexOES", (void*)glDepthRangexOES},
|
||||
{"glFogxOES", (void*)glFogxOES},
|
||||
{"glFogxvOES", (void*)glFogxvOES},
|
||||
{"glFrustumxOES", (void*)glFrustumxOES},
|
||||
{"glGetClipPlanexOES", (void*)glGetClipPlanexOES},
|
||||
{"glGetClipPlanex", (void*)glGetClipPlanex},
|
||||
{"glGetFixedvOES", (void*)glGetFixedvOES},
|
||||
{"glGetLightxvOES", (void*)glGetLightxvOES},
|
||||
{"glGetMaterialxvOES", (void*)glGetMaterialxvOES},
|
||||
{"glGetTexEnvxvOES", (void*)glGetTexEnvxvOES},
|
||||
{"glGetTexParameterxvOES", (void*)glGetTexParameterxvOES},
|
||||
{"glLightModelxOES", (void*)glLightModelxOES},
|
||||
{"glLightModelxvOES", (void*)glLightModelxvOES},
|
||||
{"glLightxOES", (void*)glLightxOES},
|
||||
{"glLightxvOES", (void*)glLightxvOES},
|
||||
{"glLineWidthxOES", (void*)glLineWidthxOES},
|
||||
{"glLoadMatrixxOES", (void*)glLoadMatrixxOES},
|
||||
{"glMaterialxOES", (void*)glMaterialxOES},
|
||||
{"glMaterialxvOES", (void*)glMaterialxvOES},
|
||||
{"glMultMatrixxOES", (void*)glMultMatrixxOES},
|
||||
{"glMultiTexCoord4xOES", (void*)glMultiTexCoord4xOES},
|
||||
{"glNormal3xOES", (void*)glNormal3xOES},
|
||||
{"glOrthoxOES", (void*)glOrthoxOES},
|
||||
{"glPointParameterxOES", (void*)glPointParameterxOES},
|
||||
{"glPointParameterxvOES", (void*)glPointParameterxvOES},
|
||||
{"glPointSizexOES", (void*)glPointSizexOES},
|
||||
{"glPolygonOffsetxOES", (void*)glPolygonOffsetxOES},
|
||||
{"glRotatexOES", (void*)glRotatexOES},
|
||||
{"glSampleCoveragexOES", (void*)glSampleCoveragexOES},
|
||||
{"glScalexOES", (void*)glScalexOES},
|
||||
{"glTexEnvxOES", (void*)glTexEnvxOES},
|
||||
{"glTexEnvxvOES", (void*)glTexEnvxvOES},
|
||||
{"glTexParameterxOES", (void*)glTexParameterxOES},
|
||||
{"glTexParameterxvOES", (void*)glTexParameterxvOES},
|
||||
{"glTranslatexOES", (void*)glTranslatexOES},
|
||||
{"glIsRenderbufferOES", (void*)glIsRenderbufferOES},
|
||||
{"glBindRenderbufferOES", (void*)glBindRenderbufferOES},
|
||||
{"glDeleteRenderbuffersOES", (void*)glDeleteRenderbuffersOES},
|
||||
{"glGenRenderbuffersOES", (void*)glGenRenderbuffersOES},
|
||||
{"glRenderbufferStorageOES", (void*)glRenderbufferStorageOES},
|
||||
{"glGetRenderbufferParameterivOES", (void*)glGetRenderbufferParameterivOES},
|
||||
{"glIsFramebufferOES", (void*)glIsFramebufferOES},
|
||||
{"glBindFramebufferOES", (void*)glBindFramebufferOES},
|
||||
{"glDeleteFramebuffersOES", (void*)glDeleteFramebuffersOES},
|
||||
{"glGenFramebuffersOES", (void*)glGenFramebuffersOES},
|
||||
{"glCheckFramebufferStatusOES", (void*)glCheckFramebufferStatusOES},
|
||||
{"glFramebufferRenderbufferOES", (void*)glFramebufferRenderbufferOES},
|
||||
{"glFramebufferTexture2DOES", (void*)glFramebufferTexture2DOES},
|
||||
{"glGetFramebufferAttachmentParameterivOES", (void*)glGetFramebufferAttachmentParameterivOES},
|
||||
{"glGenerateMipmapOES", (void*)glGenerateMipmapOES},
|
||||
{"glMapBufferOES", (void*)glMapBufferOES},
|
||||
{"glUnmapBufferOES", (void*)glUnmapBufferOES},
|
||||
{"glGetBufferPointervOES", (void*)glGetBufferPointervOES},
|
||||
{"glCurrentPaletteMatrixOES", (void*)glCurrentPaletteMatrixOES},
|
||||
{"glLoadPaletteFromModelViewMatrixOES", (void*)glLoadPaletteFromModelViewMatrixOES},
|
||||
{"glMatrixIndexPointerOES", (void*)glMatrixIndexPointerOES},
|
||||
{"glWeightPointerOES", (void*)glWeightPointerOES},
|
||||
{"glQueryMatrixxOES", (void*)glQueryMatrixxOES},
|
||||
{"glDepthRangefOES", (void*)glDepthRangefOES},
|
||||
{"glFrustumfOES", (void*)glFrustumfOES},
|
||||
{"glOrthofOES", (void*)glOrthofOES},
|
||||
{"glClipPlanefOES", (void*)glClipPlanefOES},
|
||||
{"glClipPlanefIMG", (void*)glClipPlanefIMG},
|
||||
{"glGetClipPlanefOES", (void*)glGetClipPlanefOES},
|
||||
{"glClearDepthfOES", (void*)glClearDepthfOES},
|
||||
{"glTexGenfOES", (void*)glTexGenfOES},
|
||||
{"glTexGenfvOES", (void*)glTexGenfvOES},
|
||||
{"glTexGeniOES", (void*)glTexGeniOES},
|
||||
{"glTexGenivOES", (void*)glTexGenivOES},
|
||||
{"glTexGenxOES", (void*)glTexGenxOES},
|
||||
{"glTexGenxvOES", (void*)glTexGenxvOES},
|
||||
{"glGetTexGenfvOES", (void*)glGetTexGenfvOES},
|
||||
{"glGetTexGenivOES", (void*)glGetTexGenivOES},
|
||||
{"glGetTexGenxvOES", (void*)glGetTexGenxvOES},
|
||||
{"glBindVertexArrayOES", (void*)glBindVertexArrayOES},
|
||||
{"glDeleteVertexArraysOES", (void*)glDeleteVertexArraysOES},
|
||||
{"glGenVertexArraysOES", (void*)glGenVertexArraysOES},
|
||||
{"glIsVertexArrayOES", (void*)glIsVertexArrayOES},
|
||||
{"glDiscardFramebufferEXT", (void*)glDiscardFramebufferEXT},
|
||||
{"glMultiDrawArraysEXT", (void*)glMultiDrawArraysEXT},
|
||||
{"glMultiDrawElementsEXT", (void*)glMultiDrawElementsEXT},
|
||||
{"glMultiDrawArraysSUN", (void*)glMultiDrawArraysSUN},
|
||||
{"glMultiDrawElementsSUN", (void*)glMultiDrawElementsSUN},
|
||||
{"glRenderbufferStorageMultisampleIMG", (void*)glRenderbufferStorageMultisampleIMG},
|
||||
{"glFramebufferTexture2DMultisampleIMG", (void*)glFramebufferTexture2DMultisampleIMG},
|
||||
{"glDeleteFencesNV", (void*)glDeleteFencesNV},
|
||||
{"glGenFencesNV", (void*)glGenFencesNV},
|
||||
{"glIsFenceNV", (void*)glIsFenceNV},
|
||||
{"glTestFenceNV", (void*)glTestFenceNV},
|
||||
{"glGetFenceivNV", (void*)glGetFenceivNV},
|
||||
{"glFinishFenceNV", (void*)glFinishFenceNV},
|
||||
{"glSetFenceNV", (void*)glSetFenceNV},
|
||||
{"glGetDriverControlsQCOM", (void*)glGetDriverControlsQCOM},
|
||||
{"glGetDriverControlStringQCOM", (void*)glGetDriverControlStringQCOM},
|
||||
{"glEnableDriverControlQCOM", (void*)glEnableDriverControlQCOM},
|
||||
{"glDisableDriverControlQCOM", (void*)glDisableDriverControlQCOM},
|
||||
{"glExtGetTexturesQCOM", (void*)glExtGetTexturesQCOM},
|
||||
{"glExtGetBuffersQCOM", (void*)glExtGetBuffersQCOM},
|
||||
{"glExtGetRenderbuffersQCOM", (void*)glExtGetRenderbuffersQCOM},
|
||||
{"glExtGetFramebuffersQCOM", (void*)glExtGetFramebuffersQCOM},
|
||||
{"glExtGetTexLevelParameterivQCOM", (void*)glExtGetTexLevelParameterivQCOM},
|
||||
{"glExtTexObjectStateOverrideiQCOM", (void*)glExtTexObjectStateOverrideiQCOM},
|
||||
{"glExtGetTexSubImageQCOM", (void*)glExtGetTexSubImageQCOM},
|
||||
{"glExtGetBufferPointervQCOM", (void*)glExtGetBufferPointervQCOM},
|
||||
{"glExtGetShadersQCOM", (void*)glExtGetShadersQCOM},
|
||||
{"glExtGetProgramsQCOM", (void*)glExtGetProgramsQCOM},
|
||||
{"glExtIsProgramBinaryQCOM", (void*)glExtIsProgramBinaryQCOM},
|
||||
{"glExtGetProgramBinarySourceQCOM", (void*)glExtGetProgramBinarySourceQCOM},
|
||||
{"glStartTilingQCOM", (void*)glStartTilingQCOM},
|
||||
{"glEndTilingQCOM", (void*)glEndTilingQCOM},
|
||||
};
|
||||
static int gl_num_funcs = sizeof(gl_funcs_by_name) / sizeof(struct _gl_funcs_by_name);
|
||||
|
||||
|
||||
#endif
|
||||
300
tools/emulator/opengl/system/GLESv1_enc/gl_opcodes.h
Normal file
300
tools/emulator/opengl/system/GLESv1_enc/gl_opcodes.h
Normal file
@@ -0,0 +1,300 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __GUARD_gl_opcodes_h_
|
||||
#define __GUARD_gl_opcodes_h_
|
||||
|
||||
#define OP_glAlphaFunc 1024
|
||||
#define OP_glClearColor 1025
|
||||
#define OP_glClearDepthf 1026
|
||||
#define OP_glClipPlanef 1027
|
||||
#define OP_glColor4f 1028
|
||||
#define OP_glDepthRangef 1029
|
||||
#define OP_glFogf 1030
|
||||
#define OP_glFogfv 1031
|
||||
#define OP_glFrustumf 1032
|
||||
#define OP_glGetClipPlanef 1033
|
||||
#define OP_glGetFloatv 1034
|
||||
#define OP_glGetLightfv 1035
|
||||
#define OP_glGetMaterialfv 1036
|
||||
#define OP_glGetTexEnvfv 1037
|
||||
#define OP_glGetTexParameterfv 1038
|
||||
#define OP_glLightModelf 1039
|
||||
#define OP_glLightModelfv 1040
|
||||
#define OP_glLightf 1041
|
||||
#define OP_glLightfv 1042
|
||||
#define OP_glLineWidth 1043
|
||||
#define OP_glLoadMatrixf 1044
|
||||
#define OP_glMaterialf 1045
|
||||
#define OP_glMaterialfv 1046
|
||||
#define OP_glMultMatrixf 1047
|
||||
#define OP_glMultiTexCoord4f 1048
|
||||
#define OP_glNormal3f 1049
|
||||
#define OP_glOrthof 1050
|
||||
#define OP_glPointParameterf 1051
|
||||
#define OP_glPointParameterfv 1052
|
||||
#define OP_glPointSize 1053
|
||||
#define OP_glPolygonOffset 1054
|
||||
#define OP_glRotatef 1055
|
||||
#define OP_glScalef 1056
|
||||
#define OP_glTexEnvf 1057
|
||||
#define OP_glTexEnvfv 1058
|
||||
#define OP_glTexParameterf 1059
|
||||
#define OP_glTexParameterfv 1060
|
||||
#define OP_glTranslatef 1061
|
||||
#define OP_glActiveTexture 1062
|
||||
#define OP_glAlphaFuncx 1063
|
||||
#define OP_glBindBuffer 1064
|
||||
#define OP_glBindTexture 1065
|
||||
#define OP_glBlendFunc 1066
|
||||
#define OP_glBufferData 1067
|
||||
#define OP_glBufferSubData 1068
|
||||
#define OP_glClear 1069
|
||||
#define OP_glClearColorx 1070
|
||||
#define OP_glClearDepthx 1071
|
||||
#define OP_glClearStencil 1072
|
||||
#define OP_glClientActiveTexture 1073
|
||||
#define OP_glColor4ub 1074
|
||||
#define OP_glColor4x 1075
|
||||
#define OP_glColorMask 1076
|
||||
#define OP_glColorPointer 1077
|
||||
#define OP_glCompressedTexImage2D 1078
|
||||
#define OP_glCompressedTexSubImage2D 1079
|
||||
#define OP_glCopyTexImage2D 1080
|
||||
#define OP_glCopyTexSubImage2D 1081
|
||||
#define OP_glCullFace 1082
|
||||
#define OP_glDeleteBuffers 1083
|
||||
#define OP_glDeleteTextures 1084
|
||||
#define OP_glDepthFunc 1085
|
||||
#define OP_glDepthMask 1086
|
||||
#define OP_glDepthRangex 1087
|
||||
#define OP_glDisable 1088
|
||||
#define OP_glDisableClientState 1089
|
||||
#define OP_glDrawArrays 1090
|
||||
#define OP_glDrawElements 1091
|
||||
#define OP_glEnable 1092
|
||||
#define OP_glEnableClientState 1093
|
||||
#define OP_glFinish 1094
|
||||
#define OP_glFlush 1095
|
||||
#define OP_glFogx 1096
|
||||
#define OP_glFogxv 1097
|
||||
#define OP_glFrontFace 1098
|
||||
#define OP_glFrustumx 1099
|
||||
#define OP_glGetBooleanv 1100
|
||||
#define OP_glGetBufferParameteriv 1101
|
||||
#define OP_glClipPlanex 1102
|
||||
#define OP_glGenBuffers 1103
|
||||
#define OP_glGenTextures 1104
|
||||
#define OP_glGetError 1105
|
||||
#define OP_glGetFixedv 1106
|
||||
#define OP_glGetIntegerv 1107
|
||||
#define OP_glGetLightxv 1108
|
||||
#define OP_glGetMaterialxv 1109
|
||||
#define OP_glGetPointerv 1110
|
||||
#define OP_glGetString 1111
|
||||
#define OP_glGetTexEnviv 1112
|
||||
#define OP_glGetTexEnvxv 1113
|
||||
#define OP_glGetTexParameteriv 1114
|
||||
#define OP_glGetTexParameterxv 1115
|
||||
#define OP_glHint 1116
|
||||
#define OP_glIsBuffer 1117
|
||||
#define OP_glIsEnabled 1118
|
||||
#define OP_glIsTexture 1119
|
||||
#define OP_glLightModelx 1120
|
||||
#define OP_glLightModelxv 1121
|
||||
#define OP_glLightx 1122
|
||||
#define OP_glLightxv 1123
|
||||
#define OP_glLineWidthx 1124
|
||||
#define OP_glLoadIdentity 1125
|
||||
#define OP_glLoadMatrixx 1126
|
||||
#define OP_glLogicOp 1127
|
||||
#define OP_glMaterialx 1128
|
||||
#define OP_glMaterialxv 1129
|
||||
#define OP_glMatrixMode 1130
|
||||
#define OP_glMultMatrixx 1131
|
||||
#define OP_glMultiTexCoord4x 1132
|
||||
#define OP_glNormal3x 1133
|
||||
#define OP_glNormalPointer 1134
|
||||
#define OP_glOrthox 1135
|
||||
#define OP_glPixelStorei 1136
|
||||
#define OP_glPointParameterx 1137
|
||||
#define OP_glPointParameterxv 1138
|
||||
#define OP_glPointSizex 1139
|
||||
#define OP_glPolygonOffsetx 1140
|
||||
#define OP_glPopMatrix 1141
|
||||
#define OP_glPushMatrix 1142
|
||||
#define OP_glReadPixels 1143
|
||||
#define OP_glRotatex 1144
|
||||
#define OP_glSampleCoverage 1145
|
||||
#define OP_glSampleCoveragex 1146
|
||||
#define OP_glScalex 1147
|
||||
#define OP_glScissor 1148
|
||||
#define OP_glShadeModel 1149
|
||||
#define OP_glStencilFunc 1150
|
||||
#define OP_glStencilMask 1151
|
||||
#define OP_glStencilOp 1152
|
||||
#define OP_glTexCoordPointer 1153
|
||||
#define OP_glTexEnvi 1154
|
||||
#define OP_glTexEnvx 1155
|
||||
#define OP_glTexEnviv 1156
|
||||
#define OP_glTexEnvxv 1157
|
||||
#define OP_glTexImage2D 1158
|
||||
#define OP_glTexParameteri 1159
|
||||
#define OP_glTexParameterx 1160
|
||||
#define OP_glTexParameteriv 1161
|
||||
#define OP_glTexParameterxv 1162
|
||||
#define OP_glTexSubImage2D 1163
|
||||
#define OP_glTranslatex 1164
|
||||
#define OP_glVertexPointer 1165
|
||||
#define OP_glViewport 1166
|
||||
#define OP_glPointSizePointerOES 1167
|
||||
#define OP_glVertexPointerOffset 1168
|
||||
#define OP_glColorPointerOffset 1169
|
||||
#define OP_glNormalPointerOffset 1170
|
||||
#define OP_glPointSizePointerOffset 1171
|
||||
#define OP_glTexCoordPointerOffset 1172
|
||||
#define OP_glWeightPointerOffset 1173
|
||||
#define OP_glMatrixIndexPointerOffset 1174
|
||||
#define OP_glVertexPointerData 1175
|
||||
#define OP_glColorPointerData 1176
|
||||
#define OP_glNormalPointerData 1177
|
||||
#define OP_glTexCoordPointerData 1178
|
||||
#define OP_glPointSizePointerData 1179
|
||||
#define OP_glWeightPointerData 1180
|
||||
#define OP_glMatrixIndexPointerData 1181
|
||||
#define OP_glDrawElementsOffset 1182
|
||||
#define OP_glDrawElementsData 1183
|
||||
#define OP_glGetCompressedTextureFormats 1184
|
||||
#define OP_glFinishRoundTrip 1185
|
||||
#define OP_glBlendEquationSeparateOES 1186
|
||||
#define OP_glBlendFuncSeparateOES 1187
|
||||
#define OP_glBlendEquationOES 1188
|
||||
#define OP_glDrawTexsOES 1189
|
||||
#define OP_glDrawTexiOES 1190
|
||||
#define OP_glDrawTexxOES 1191
|
||||
#define OP_glDrawTexsvOES 1192
|
||||
#define OP_glDrawTexivOES 1193
|
||||
#define OP_glDrawTexxvOES 1194
|
||||
#define OP_glDrawTexfOES 1195
|
||||
#define OP_glDrawTexfvOES 1196
|
||||
#define OP_glEGLImageTargetTexture2DOES 1197
|
||||
#define OP_glEGLImageTargetRenderbufferStorageOES 1198
|
||||
#define OP_glAlphaFuncxOES 1199
|
||||
#define OP_glClearColorxOES 1200
|
||||
#define OP_glClearDepthxOES 1201
|
||||
#define OP_glClipPlanexOES 1202
|
||||
#define OP_glClipPlanexIMG 1203
|
||||
#define OP_glColor4xOES 1204
|
||||
#define OP_glDepthRangexOES 1205
|
||||
#define OP_glFogxOES 1206
|
||||
#define OP_glFogxvOES 1207
|
||||
#define OP_glFrustumxOES 1208
|
||||
#define OP_glGetClipPlanexOES 1209
|
||||
#define OP_glGetClipPlanex 1210
|
||||
#define OP_glGetFixedvOES 1211
|
||||
#define OP_glGetLightxvOES 1212
|
||||
#define OP_glGetMaterialxvOES 1213
|
||||
#define OP_glGetTexEnvxvOES 1214
|
||||
#define OP_glGetTexParameterxvOES 1215
|
||||
#define OP_glLightModelxOES 1216
|
||||
#define OP_glLightModelxvOES 1217
|
||||
#define OP_glLightxOES 1218
|
||||
#define OP_glLightxvOES 1219
|
||||
#define OP_glLineWidthxOES 1220
|
||||
#define OP_glLoadMatrixxOES 1221
|
||||
#define OP_glMaterialxOES 1222
|
||||
#define OP_glMaterialxvOES 1223
|
||||
#define OP_glMultMatrixxOES 1224
|
||||
#define OP_glMultiTexCoord4xOES 1225
|
||||
#define OP_glNormal3xOES 1226
|
||||
#define OP_glOrthoxOES 1227
|
||||
#define OP_glPointParameterxOES 1228
|
||||
#define OP_glPointParameterxvOES 1229
|
||||
#define OP_glPointSizexOES 1230
|
||||
#define OP_glPolygonOffsetxOES 1231
|
||||
#define OP_glRotatexOES 1232
|
||||
#define OP_glSampleCoveragexOES 1233
|
||||
#define OP_glScalexOES 1234
|
||||
#define OP_glTexEnvxOES 1235
|
||||
#define OP_glTexEnvxvOES 1236
|
||||
#define OP_glTexParameterxOES 1237
|
||||
#define OP_glTexParameterxvOES 1238
|
||||
#define OP_glTranslatexOES 1239
|
||||
#define OP_glIsRenderbufferOES 1240
|
||||
#define OP_glBindRenderbufferOES 1241
|
||||
#define OP_glDeleteRenderbuffersOES 1242
|
||||
#define OP_glGenRenderbuffersOES 1243
|
||||
#define OP_glRenderbufferStorageOES 1244
|
||||
#define OP_glGetRenderbufferParameterivOES 1245
|
||||
#define OP_glIsFramebufferOES 1246
|
||||
#define OP_glBindFramebufferOES 1247
|
||||
#define OP_glDeleteFramebuffersOES 1248
|
||||
#define OP_glGenFramebuffersOES 1249
|
||||
#define OP_glCheckFramebufferStatusOES 1250
|
||||
#define OP_glFramebufferRenderbufferOES 1251
|
||||
#define OP_glFramebufferTexture2DOES 1252
|
||||
#define OP_glGetFramebufferAttachmentParameterivOES 1253
|
||||
#define OP_glGenerateMipmapOES 1254
|
||||
#define OP_glMapBufferOES 1255
|
||||
#define OP_glUnmapBufferOES 1256
|
||||
#define OP_glGetBufferPointervOES 1257
|
||||
#define OP_glCurrentPaletteMatrixOES 1258
|
||||
#define OP_glLoadPaletteFromModelViewMatrixOES 1259
|
||||
#define OP_glMatrixIndexPointerOES 1260
|
||||
#define OP_glWeightPointerOES 1261
|
||||
#define OP_glQueryMatrixxOES 1262
|
||||
#define OP_glDepthRangefOES 1263
|
||||
#define OP_glFrustumfOES 1264
|
||||
#define OP_glOrthofOES 1265
|
||||
#define OP_glClipPlanefOES 1266
|
||||
#define OP_glClipPlanefIMG 1267
|
||||
#define OP_glGetClipPlanefOES 1268
|
||||
#define OP_glClearDepthfOES 1269
|
||||
#define OP_glTexGenfOES 1270
|
||||
#define OP_glTexGenfvOES 1271
|
||||
#define OP_glTexGeniOES 1272
|
||||
#define OP_glTexGenivOES 1273
|
||||
#define OP_glTexGenxOES 1274
|
||||
#define OP_glTexGenxvOES 1275
|
||||
#define OP_glGetTexGenfvOES 1276
|
||||
#define OP_glGetTexGenivOES 1277
|
||||
#define OP_glGetTexGenxvOES 1278
|
||||
#define OP_glBindVertexArrayOES 1279
|
||||
#define OP_glDeleteVertexArraysOES 1280
|
||||
#define OP_glGenVertexArraysOES 1281
|
||||
#define OP_glIsVertexArrayOES 1282
|
||||
#define OP_glDiscardFramebufferEXT 1283
|
||||
#define OP_glMultiDrawArraysEXT 1284
|
||||
#define OP_glMultiDrawElementsEXT 1285
|
||||
#define OP_glMultiDrawArraysSUN 1286
|
||||
#define OP_glMultiDrawElementsSUN 1287
|
||||
#define OP_glRenderbufferStorageMultisampleIMG 1288
|
||||
#define OP_glFramebufferTexture2DMultisampleIMG 1289
|
||||
#define OP_glDeleteFencesNV 1290
|
||||
#define OP_glGenFencesNV 1291
|
||||
#define OP_glIsFenceNV 1292
|
||||
#define OP_glTestFenceNV 1293
|
||||
#define OP_glGetFenceivNV 1294
|
||||
#define OP_glFinishFenceNV 1295
|
||||
#define OP_glSetFenceNV 1296
|
||||
#define OP_glGetDriverControlsQCOM 1297
|
||||
#define OP_glGetDriverControlStringQCOM 1298
|
||||
#define OP_glEnableDriverControlQCOM 1299
|
||||
#define OP_glDisableDriverControlQCOM 1300
|
||||
#define OP_glExtGetTexturesQCOM 1301
|
||||
#define OP_glExtGetBuffersQCOM 1302
|
||||
#define OP_glExtGetRenderbuffersQCOM 1303
|
||||
#define OP_glExtGetFramebuffersQCOM 1304
|
||||
#define OP_glExtGetTexLevelParameterivQCOM 1305
|
||||
#define OP_glExtTexObjectStateOverrideiQCOM 1306
|
||||
#define OP_glExtGetTexSubImageQCOM 1307
|
||||
#define OP_glExtGetBufferPointervQCOM 1308
|
||||
#define OP_glExtGetShadersQCOM 1309
|
||||
#define OP_glExtGetProgramsQCOM 1310
|
||||
#define OP_glExtIsProgramBinaryQCOM 1311
|
||||
#define OP_glExtGetProgramBinarySourceQCOM 1312
|
||||
#define OP_glStartTilingQCOM 1313
|
||||
#define OP_glEndTilingQCOM 1314
|
||||
#define OP_last 1315
|
||||
|
||||
|
||||
#endif
|
||||
20
tools/emulator/opengl/system/GLESv1_enc/gl_types.h
Normal file
20
tools/emulator/opengl/system/GLESv1_enc/gl_types.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __GL_TYPES__H
|
||||
#define __GL_TYPES__H
|
||||
|
||||
#include "gl_base_types.h"
|
||||
#endif
|
||||
12
tools/emulator/opengl/system/GLESv2/Android.mk
Normal file
12
tools/emulator/opengl/system/GLESv2/Android.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
### GLESv2 implementation ###########################################
|
||||
$(call emugl-begin-shared-library,libGLESv2_emulation)
|
||||
$(call emugl-import,libOpenglSystemCommon libGLESv2_enc lib_renderControl_enc)
|
||||
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"GLESv2_emulation\" -DGL_GLEXT_PROTOTYPES
|
||||
|
||||
LOCAL_SRC_FILES := gl2.cpp
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
|
||||
|
||||
$(call emugl-end-module)
|
||||
143
tools/emulator/opengl/system/GLESv2/gl2.cpp
Normal file
143
tools/emulator/opengl/system/GLESv2/gl2.cpp
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Copyright 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "EGLClientIface.h"
|
||||
#include "HostConnection.h"
|
||||
#include "GL2Encoder.h"
|
||||
#include "GLES/gl.h"
|
||||
#include "GLES/glext.h"
|
||||
#include "ErrorLog.h"
|
||||
#include "gralloc_cb.h"
|
||||
#include "ThreadInfo.h"
|
||||
|
||||
//XXX: fix this macro to get the context from fast tls path
|
||||
#define GET_CONTEXT GL2Encoder * ctx = getEGLThreadInfo()->hostConn->gl2Encoder();
|
||||
|
||||
#include "gl2_entry.cpp"
|
||||
|
||||
//The functions table
|
||||
#include "gl2_ftable.h"
|
||||
|
||||
|
||||
static EGLClient_eglInterface * s_egl = NULL;
|
||||
static EGLClient_glesInterface * s_gl = NULL;
|
||||
|
||||
#define DEFINE_AND_VALIDATE_HOST_CONNECTION(ret) \
|
||||
HostConnection *hostCon = HostConnection::get(); \
|
||||
if (!hostCon) { \
|
||||
ALOGE("egl: Failed to get host connection\n"); \
|
||||
return ret; \
|
||||
} \
|
||||
renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
|
||||
if (!rcEnc) { \
|
||||
ALOGE("egl: Failed to get renderControl encoder context\n"); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
//GL extensions
|
||||
void glEGLImageTargetTexture2DOES(void * self, GLenum target, GLeglImageOES image)
|
||||
{
|
||||
DBG("glEGLImageTargetTexture2DOES v2 target=%#x img=%p\n", target, image);
|
||||
//TODO: check error - we don't have a way to set gl error
|
||||
android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
|
||||
|
||||
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GET_CONTEXT;
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION();
|
||||
|
||||
ctx->override2DTextureTarget(target);
|
||||
rcEnc->rcBindTexture(rcEnc, ((cb_handle_t *)(native_buffer->handle))->hostHandle);
|
||||
ctx->restore2DTextureTarget();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void glEGLImageTargetRenderbufferStorageOES(void *self, GLenum target, GLeglImageOES image)
|
||||
{
|
||||
DBG("glEGLImageTargetRenderbufferStorageOES v2 image=%p\n", image);
|
||||
//TODO: check error - we don't have a way to set gl error
|
||||
android_native_buffer_t* native_buffer = (android_native_buffer_t*)image;
|
||||
|
||||
if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (native_buffer->common.version != sizeof(android_native_buffer_t)) {
|
||||
return;
|
||||
}
|
||||
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION();
|
||||
rcEnc->rcBindRenderbuffer(rcEnc, ((cb_handle_t *)(native_buffer->handle))->hostHandle);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void * getProcAddress(const char * procname)
|
||||
{
|
||||
// search in GL function table
|
||||
for (int i=0; i<gl2_num_funcs; i++) {
|
||||
if (!strcmp(gl2_funcs_by_name[i].name, procname)) {
|
||||
return gl2_funcs_by_name[i].proc;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void finish()
|
||||
{
|
||||
glFinish();
|
||||
}
|
||||
|
||||
const GLubyte *my_glGetString (void *self, GLenum name)
|
||||
{
|
||||
if (s_egl) {
|
||||
return (const GLubyte*)s_egl->getGLString(name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void init()
|
||||
{
|
||||
GET_CONTEXT;
|
||||
ctx->set_glEGLImageTargetTexture2DOES(glEGLImageTargetTexture2DOES);
|
||||
ctx->set_glEGLImageTargetRenderbufferStorageOES(glEGLImageTargetRenderbufferStorageOES);
|
||||
ctx->set_glGetString(my_glGetString);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
|
||||
{
|
||||
s_egl = eglIface;
|
||||
|
||||
if (!s_gl) {
|
||||
s_gl = new EGLClient_glesInterface();
|
||||
s_gl->getProcAddress = getProcAddress;
|
||||
s_gl->finish = finish;
|
||||
s_gl->init = init;
|
||||
}
|
||||
|
||||
return s_gl;
|
||||
}
|
||||
} //extern
|
||||
|
||||
|
||||
20
tools/emulator/opengl/system/GLESv2_enc/Android.mk
Normal file
20
tools/emulator/opengl/system/GLESv2_enc/Android.mk
Normal file
@@ -0,0 +1,20 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
### GLESv2_enc Encoder ###########################################
|
||||
$(call emugl-begin-shared-library,libGLESv2_enc)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
GL2EncoderUtils.cpp \
|
||||
GL2Encoder.cpp \
|
||||
gl2_client_context.cpp \
|
||||
gl2_enc.cpp \
|
||||
gl2_entry.cpp
|
||||
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv2_enc\"
|
||||
|
||||
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
|
||||
$(call emugl-import,libOpenglCodecCommon)
|
||||
|
||||
$(call emugl-end-module)
|
||||
|
||||
|
||||
1197
tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.cpp
Normal file
1197
tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.cpp
Normal file
File diff suppressed because it is too large
Load Diff
216
tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.h
Normal file
216
tools/emulator/opengl/system/GLESv2_enc/GL2Encoder.h
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _GL2_ENCODER_H_
|
||||
#define _GL2_ENCODER_H_
|
||||
|
||||
#include "gl2_enc.h"
|
||||
#include "GLClientState.h"
|
||||
#include "GLSharedGroup.h"
|
||||
#include "FixedBuffer.h"
|
||||
|
||||
|
||||
class GL2Encoder : public gl2_encoder_context_t {
|
||||
public:
|
||||
GL2Encoder(IOStream *stream);
|
||||
virtual ~GL2Encoder();
|
||||
void setClientState(GLClientState *state) {
|
||||
m_state = state;
|
||||
}
|
||||
void setSharedGroup(GLSharedGroupPtr shared){ m_shared = shared; }
|
||||
const GLClientState *state() { return m_state; }
|
||||
const GLSharedGroupPtr shared() { return m_shared; }
|
||||
void flush() { m_stream->flush(); }
|
||||
|
||||
void setInitialized(){ m_initialized = true; };
|
||||
bool isInitialized(){ return m_initialized; };
|
||||
|
||||
virtual void setError(GLenum error){ m_error = error; };
|
||||
virtual GLenum getError() { return m_error; };
|
||||
|
||||
void override2DTextureTarget(GLenum target);
|
||||
void restore2DTextureTarget();
|
||||
|
||||
private:
|
||||
|
||||
bool m_initialized;
|
||||
GLClientState *m_state;
|
||||
GLSharedGroupPtr m_shared;
|
||||
GLenum m_error;
|
||||
|
||||
GLint *m_compressedTextureFormats;
|
||||
GLint m_num_compressedTextureFormats;
|
||||
GLint *getCompressedTextureFormats();
|
||||
|
||||
FixedBuffer m_fixedBuffer;
|
||||
|
||||
void sendVertexAttributes(GLint first, GLsizei count);
|
||||
bool updateHostTexture2DBinding(GLenum texUnit, GLenum newTarget);
|
||||
|
||||
glGetError_client_proc_t m_glGetError_enc;
|
||||
static GLenum s_glGetError(void * self);
|
||||
|
||||
glFlush_client_proc_t m_glFlush_enc;
|
||||
static void s_glFlush(void * self);
|
||||
|
||||
glPixelStorei_client_proc_t m_glPixelStorei_enc;
|
||||
static void s_glPixelStorei(void *self, GLenum param, GLint value);
|
||||
|
||||
glGetString_client_proc_t m_glGetString_enc;
|
||||
static const GLubyte * s_glGetString(void *self, GLenum name);
|
||||
|
||||
glBindBuffer_client_proc_t m_glBindBuffer_enc;
|
||||
static void s_glBindBuffer(void *self, GLenum target, GLuint id);
|
||||
|
||||
|
||||
glBufferData_client_proc_t m_glBufferData_enc;
|
||||
static void s_glBufferData(void *self, GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
glBufferSubData_client_proc_t m_glBufferSubData_enc;
|
||||
static void s_glBufferSubData(void *self, GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
|
||||
glDeleteBuffers_client_proc_t m_glDeleteBuffers_enc;
|
||||
static void s_glDeleteBuffers(void *self, GLsizei n, const GLuint * buffers);
|
||||
|
||||
glDrawArrays_client_proc_t m_glDrawArrays_enc;
|
||||
static void s_glDrawArrays(void *self, GLenum mode, GLint first, GLsizei count);
|
||||
|
||||
glDrawElements_client_proc_t m_glDrawElements_enc;
|
||||
static void s_glDrawElements(void *self, GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
|
||||
|
||||
glGetIntegerv_client_proc_t m_glGetIntegerv_enc;
|
||||
static void s_glGetIntegerv(void *self, GLenum pname, GLint *ptr);
|
||||
|
||||
glGetFloatv_client_proc_t m_glGetFloatv_enc;
|
||||
static void s_glGetFloatv(void *self, GLenum pname, GLfloat *ptr);
|
||||
|
||||
glGetBooleanv_client_proc_t m_glGetBooleanv_enc;
|
||||
static void s_glGetBooleanv(void *self, GLenum pname, GLboolean *ptr);
|
||||
|
||||
glVertexAttribPointer_client_proc_t m_glVertexAttribPointer_enc;
|
||||
static void s_glVertexAtrribPointer(void *self, GLuint indx, GLint size, GLenum type,
|
||||
GLboolean normalized, GLsizei stride, const GLvoid * ptr);
|
||||
|
||||
glEnableVertexAttribArray_client_proc_t m_glEnableVertexAttribArray_enc;
|
||||
static void s_glEnableVertexAttribArray(void *self, GLuint index);
|
||||
|
||||
glDisableVertexAttribArray_client_proc_t m_glDisableVertexAttribArray_enc;
|
||||
static void s_glDisableVertexAttribArray(void *self, GLuint index);
|
||||
|
||||
glGetVertexAttribiv_client_proc_t m_glGetVertexAttribiv_enc;
|
||||
static void s_glGetVertexAttribiv(void *self, GLuint index, GLenum pname, GLint *params);
|
||||
|
||||
glGetVertexAttribfv_client_proc_t m_glGetVertexAttribfv_enc;
|
||||
static void s_glGetVertexAttribfv(void *self, GLuint index, GLenum pname, GLfloat *params);
|
||||
|
||||
glGetVertexAttribPointerv_client_proc_t m_glGetVertexAttribPointerv;
|
||||
static void s_glGetVertexAttribPointerv(void *self, GLuint index, GLenum pname, GLvoid **pointer);
|
||||
|
||||
static void s_glShaderSource(void *self, GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
|
||||
|
||||
static void s_glFinish(void *self);
|
||||
|
||||
glLinkProgram_client_proc_t m_glLinkProgram_enc;
|
||||
static void s_glLinkProgram(void *self, GLuint program);
|
||||
|
||||
glDeleteProgram_client_proc_t m_glDeleteProgram_enc;
|
||||
static void s_glDeleteProgram(void * self, GLuint program);
|
||||
|
||||
glGetUniformiv_client_proc_t m_glGetUniformiv_enc;
|
||||
static void s_glGetUniformiv(void *self, GLuint program, GLint location , GLint *params);
|
||||
|
||||
glGetUniformfv_client_proc_t m_glGetUniformfv_enc;
|
||||
static void s_glGetUniformfv(void *self, GLuint program, GLint location , GLfloat *params);
|
||||
|
||||
glCreateProgram_client_proc_t m_glCreateProgram_enc;
|
||||
static GLuint s_glCreateProgram(void *self);
|
||||
|
||||
glCreateShader_client_proc_t m_glCreateShader_enc;
|
||||
static GLuint s_glCreateShader(void *self, GLenum shaderType);
|
||||
|
||||
glDeleteShader_client_proc_t m_glDeleteShader_enc;
|
||||
static void s_glDeleteShader(void *self, GLuint shader);
|
||||
|
||||
glAttachShader_client_proc_t m_glAttachShader_enc;
|
||||
static void s_glAttachShader(void *self, GLuint program, GLuint shader);
|
||||
|
||||
glDetachShader_client_proc_t m_glDetachShader_enc;
|
||||
static void s_glDetachShader(void *self, GLuint program, GLuint shader);
|
||||
|
||||
glGetUniformLocation_client_proc_t m_glGetUniformLocation_enc;
|
||||
static int s_glGetUniformLocation(void *self, GLuint program, const GLchar *name);
|
||||
glUseProgram_client_proc_t m_glUseProgram_enc;
|
||||
|
||||
glUniform1f_client_proc_t m_glUniform1f_enc;
|
||||
glUniform1fv_client_proc_t m_glUniform1fv_enc;
|
||||
glUniform1i_client_proc_t m_glUniform1i_enc;
|
||||
glUniform1iv_client_proc_t m_glUniform1iv_enc;
|
||||
glUniform2f_client_proc_t m_glUniform2f_enc;
|
||||
glUniform2fv_client_proc_t m_glUniform2fv_enc;
|
||||
glUniform2i_client_proc_t m_glUniform2i_enc;
|
||||
glUniform2iv_client_proc_t m_glUniform2iv_enc;
|
||||
glUniform3f_client_proc_t m_glUniform3f_enc;
|
||||
glUniform3fv_client_proc_t m_glUniform3fv_enc;
|
||||
glUniform3i_client_proc_t m_glUniform3i_enc;
|
||||
glUniform3iv_client_proc_t m_glUniform3iv_enc;
|
||||
glUniform4f_client_proc_t m_glUniform4f_enc;
|
||||
glUniform4fv_client_proc_t m_glUniform4fv_enc;
|
||||
glUniform4i_client_proc_t m_glUniform4i_enc;
|
||||
glUniform4iv_client_proc_t m_glUniform4iv_enc;
|
||||
glUniformMatrix2fv_client_proc_t m_glUniformMatrix2fv_enc;
|
||||
glUniformMatrix3fv_client_proc_t m_glUniformMatrix3fv_enc;
|
||||
glUniformMatrix4fv_client_proc_t m_glUniformMatrix4fv_enc;
|
||||
|
||||
static void s_glUseProgram(void *self, GLuint program);
|
||||
static void s_glUniform1f(void *self , GLint location, GLfloat x);
|
||||
static void s_glUniform1fv(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
static void s_glUniform1i(void *self , GLint location, GLint x);
|
||||
static void s_glUniform1iv(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
static void s_glUniform2f(void *self , GLint location, GLfloat x, GLfloat y);
|
||||
static void s_glUniform2fv(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
static void s_glUniform2i(void *self , GLint location, GLint x, GLint y);
|
||||
static void s_glUniform2iv(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
static void s_glUniform3f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z);
|
||||
static void s_glUniform3fv(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
static void s_glUniform3i(void *self , GLint location, GLint x, GLint y, GLint z);
|
||||
static void s_glUniform3iv(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
static void s_glUniform4f(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
static void s_glUniform4fv(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
static void s_glUniform4i(void *self , GLint location, GLint x, GLint y, GLint z, GLint w);
|
||||
static void s_glUniform4iv(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
static void s_glUniformMatrix2fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
static void s_glUniformMatrix3fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
static void s_glUniformMatrix4fv(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
|
||||
glActiveTexture_client_proc_t m_glActiveTexture_enc;
|
||||
glBindTexture_client_proc_t m_glBindTexture_enc;
|
||||
glDeleteTextures_client_proc_t m_glDeleteTextures_enc;
|
||||
glGetTexParameterfv_client_proc_t m_glGetTexParameterfv_enc;
|
||||
glGetTexParameteriv_client_proc_t m_glGetTexParameteriv_enc;
|
||||
glTexParameterf_client_proc_t m_glTexParameterf_enc;
|
||||
glTexParameterfv_client_proc_t m_glTexParameterfv_enc;
|
||||
glTexParameteri_client_proc_t m_glTexParameteri_enc;
|
||||
glTexParameteriv_client_proc_t m_glTexParameteriv_enc;
|
||||
|
||||
static void s_glActiveTexture(void* self, GLenum texture);
|
||||
static void s_glBindTexture(void* self, GLenum target, GLuint texture);
|
||||
static void s_glDeleteTextures(void* self, GLsizei n, const GLuint* textures);
|
||||
static void s_glGetTexParameterfv(void* self, GLenum target, GLenum pname, GLfloat* params);
|
||||
static void s_glGetTexParameteriv(void* self, GLenum target, GLenum pname, GLint* params);
|
||||
static void s_glTexParameterf(void* self, GLenum target, GLenum pname, GLfloat param);
|
||||
static void s_glTexParameterfv(void* self, GLenum target, GLenum pname, const GLfloat* params);
|
||||
static void s_glTexParameteri(void* self, GLenum target, GLenum pname, GLint param);
|
||||
static void s_glTexParameteriv(void* self, GLenum target, GLenum pname, const GLint* params);
|
||||
};
|
||||
#endif
|
||||
39
tools/emulator/opengl/system/GLESv2_enc/GL2EncoderUtils.cpp
Normal file
39
tools/emulator/opengl/system/GLESv2_enc/GL2EncoderUtils.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "GL2Encoder.h"
|
||||
#include <assert.h>
|
||||
|
||||
size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
|
||||
{
|
||||
GL2Encoder *ctx = (GL2Encoder *)self;
|
||||
assert (ctx->state() != NULL);
|
||||
return ctx->state()->pixelDataSize(width, height, format, type, pack);
|
||||
}
|
||||
|
||||
size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack)
|
||||
{
|
||||
size_t layerSize = pixelDataSize(self, width, height, format, type, pack);
|
||||
return layerSize * depth;
|
||||
}
|
||||
|
||||
GLenum uniformType(void * self, GLuint program, GLint location)
|
||||
{
|
||||
GL2Encoder * ctx = (GL2Encoder *) self;
|
||||
assert (ctx->shared() != NULL);
|
||||
return ctx->shared()->getProgramUniformType(program, location);
|
||||
}
|
||||
24
tools/emulator/opengl/system/GLESv2_enc/GL2EncoderUtils.h
Normal file
24
tools/emulator/opengl/system/GLESv2_enc/GL2EncoderUtils.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef GL2_ENCODER_UTILS_H
|
||||
#define GL2_ENCLODER_UTILS_H
|
||||
|
||||
extern "C" {
|
||||
size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
|
||||
size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack);
|
||||
GLenum uniformType(void * self, GLuint program, GLint location);
|
||||
};
|
||||
#endif
|
||||
225
tools/emulator/opengl/system/GLESv2_enc/gl2_client_context.cpp
Normal file
225
tools/emulator/opengl/system/GLESv2_enc/gl2_client_context.cpp
Normal file
@@ -0,0 +1,225 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "gl2_client_context.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int gl2_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = getProc("glActiveTexture", userData); set_glActiveTexture((glActiveTexture_client_proc_t)ptr);
|
||||
ptr = getProc("glAttachShader", userData); set_glAttachShader((glAttachShader_client_proc_t)ptr);
|
||||
ptr = getProc("glBindAttribLocation", userData); set_glBindAttribLocation((glBindAttribLocation_client_proc_t)ptr);
|
||||
ptr = getProc("glBindBuffer", userData); set_glBindBuffer((glBindBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glBindFramebuffer", userData); set_glBindFramebuffer((glBindFramebuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glBindRenderbuffer", userData); set_glBindRenderbuffer((glBindRenderbuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glBindTexture", userData); set_glBindTexture((glBindTexture_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendColor", userData); set_glBlendColor((glBlendColor_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendEquation", userData); set_glBlendEquation((glBlendEquation_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendEquationSeparate", userData); set_glBlendEquationSeparate((glBlendEquationSeparate_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendFunc", userData); set_glBlendFunc((glBlendFunc_client_proc_t)ptr);
|
||||
ptr = getProc("glBlendFuncSeparate", userData); set_glBlendFuncSeparate((glBlendFuncSeparate_client_proc_t)ptr);
|
||||
ptr = getProc("glBufferData", userData); set_glBufferData((glBufferData_client_proc_t)ptr);
|
||||
ptr = getProc("glBufferSubData", userData); set_glBufferSubData((glBufferSubData_client_proc_t)ptr);
|
||||
ptr = getProc("glCheckFramebufferStatus", userData); set_glCheckFramebufferStatus((glCheckFramebufferStatus_client_proc_t)ptr);
|
||||
ptr = getProc("glClear", userData); set_glClear((glClear_client_proc_t)ptr);
|
||||
ptr = getProc("glClearColor", userData); set_glClearColor((glClearColor_client_proc_t)ptr);
|
||||
ptr = getProc("glClearDepthf", userData); set_glClearDepthf((glClearDepthf_client_proc_t)ptr);
|
||||
ptr = getProc("glClearStencil", userData); set_glClearStencil((glClearStencil_client_proc_t)ptr);
|
||||
ptr = getProc("glColorMask", userData); set_glColorMask((glColorMask_client_proc_t)ptr);
|
||||
ptr = getProc("glCompileShader", userData); set_glCompileShader((glCompileShader_client_proc_t)ptr);
|
||||
ptr = getProc("glCompressedTexImage2D", userData); set_glCompressedTexImage2D((glCompressedTexImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCompressedTexSubImage2D", userData); set_glCompressedTexSubImage2D((glCompressedTexSubImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCopyTexImage2D", userData); set_glCopyTexImage2D((glCopyTexImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCopyTexSubImage2D", userData); set_glCopyTexSubImage2D((glCopyTexSubImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glCreateProgram", userData); set_glCreateProgram((glCreateProgram_client_proc_t)ptr);
|
||||
ptr = getProc("glCreateShader", userData); set_glCreateShader((glCreateShader_client_proc_t)ptr);
|
||||
ptr = getProc("glCullFace", userData); set_glCullFace((glCullFace_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteBuffers", userData); set_glDeleteBuffers((glDeleteBuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteFramebuffers", userData); set_glDeleteFramebuffers((glDeleteFramebuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteProgram", userData); set_glDeleteProgram((glDeleteProgram_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteRenderbuffers", userData); set_glDeleteRenderbuffers((glDeleteRenderbuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteShader", userData); set_glDeleteShader((glDeleteShader_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteTextures", userData); set_glDeleteTextures((glDeleteTextures_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthFunc", userData); set_glDepthFunc((glDepthFunc_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthMask", userData); set_glDepthMask((glDepthMask_client_proc_t)ptr);
|
||||
ptr = getProc("glDepthRangef", userData); set_glDepthRangef((glDepthRangef_client_proc_t)ptr);
|
||||
ptr = getProc("glDetachShader", userData); set_glDetachShader((glDetachShader_client_proc_t)ptr);
|
||||
ptr = getProc("glDisable", userData); set_glDisable((glDisable_client_proc_t)ptr);
|
||||
ptr = getProc("glDisableVertexAttribArray", userData); set_glDisableVertexAttribArray((glDisableVertexAttribArray_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawArrays", userData); set_glDrawArrays((glDrawArrays_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawElements", userData); set_glDrawElements((glDrawElements_client_proc_t)ptr);
|
||||
ptr = getProc("glEnable", userData); set_glEnable((glEnable_client_proc_t)ptr);
|
||||
ptr = getProc("glEnableVertexAttribArray", userData); set_glEnableVertexAttribArray((glEnableVertexAttribArray_client_proc_t)ptr);
|
||||
ptr = getProc("glFinish", userData); set_glFinish((glFinish_client_proc_t)ptr);
|
||||
ptr = getProc("glFlush", userData); set_glFlush((glFlush_client_proc_t)ptr);
|
||||
ptr = getProc("glFramebufferRenderbuffer", userData); set_glFramebufferRenderbuffer((glFramebufferRenderbuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glFramebufferTexture2D", userData); set_glFramebufferTexture2D((glFramebufferTexture2D_client_proc_t)ptr);
|
||||
ptr = getProc("glFrontFace", userData); set_glFrontFace((glFrontFace_client_proc_t)ptr);
|
||||
ptr = getProc("glGenBuffers", userData); set_glGenBuffers((glGenBuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glGenerateMipmap", userData); set_glGenerateMipmap((glGenerateMipmap_client_proc_t)ptr);
|
||||
ptr = getProc("glGenFramebuffers", userData); set_glGenFramebuffers((glGenFramebuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glGenRenderbuffers", userData); set_glGenRenderbuffers((glGenRenderbuffers_client_proc_t)ptr);
|
||||
ptr = getProc("glGenTextures", userData); set_glGenTextures((glGenTextures_client_proc_t)ptr);
|
||||
ptr = getProc("glGetActiveAttrib", userData); set_glGetActiveAttrib((glGetActiveAttrib_client_proc_t)ptr);
|
||||
ptr = getProc("glGetActiveUniform", userData); set_glGetActiveUniform((glGetActiveUniform_client_proc_t)ptr);
|
||||
ptr = getProc("glGetAttachedShaders", userData); set_glGetAttachedShaders((glGetAttachedShaders_client_proc_t)ptr);
|
||||
ptr = getProc("glGetAttribLocation", userData); set_glGetAttribLocation((glGetAttribLocation_client_proc_t)ptr);
|
||||
ptr = getProc("glGetBooleanv", userData); set_glGetBooleanv((glGetBooleanv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetBufferParameteriv", userData); set_glGetBufferParameteriv((glGetBufferParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetError", userData); set_glGetError((glGetError_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFloatv", userData); set_glGetFloatv((glGetFloatv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFramebufferAttachmentParameteriv", userData); set_glGetFramebufferAttachmentParameteriv((glGetFramebufferAttachmentParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetIntegerv", userData); set_glGetIntegerv((glGetIntegerv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetProgramiv", userData); set_glGetProgramiv((glGetProgramiv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetProgramInfoLog", userData); set_glGetProgramInfoLog((glGetProgramInfoLog_client_proc_t)ptr);
|
||||
ptr = getProc("glGetRenderbufferParameteriv", userData); set_glGetRenderbufferParameteriv((glGetRenderbufferParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetShaderiv", userData); set_glGetShaderiv((glGetShaderiv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetShaderInfoLog", userData); set_glGetShaderInfoLog((glGetShaderInfoLog_client_proc_t)ptr);
|
||||
ptr = getProc("glGetShaderPrecisionFormat", userData); set_glGetShaderPrecisionFormat((glGetShaderPrecisionFormat_client_proc_t)ptr);
|
||||
ptr = getProc("glGetShaderSource", userData); set_glGetShaderSource((glGetShaderSource_client_proc_t)ptr);
|
||||
ptr = getProc("glGetString", userData); set_glGetString((glGetString_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexParameterfv", userData); set_glGetTexParameterfv((glGetTexParameterfv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetTexParameteriv", userData); set_glGetTexParameteriv((glGetTexParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetUniformfv", userData); set_glGetUniformfv((glGetUniformfv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetUniformiv", userData); set_glGetUniformiv((glGetUniformiv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetUniformLocation", userData); set_glGetUniformLocation((glGetUniformLocation_client_proc_t)ptr);
|
||||
ptr = getProc("glGetVertexAttribfv", userData); set_glGetVertexAttribfv((glGetVertexAttribfv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetVertexAttribiv", userData); set_glGetVertexAttribiv((glGetVertexAttribiv_client_proc_t)ptr);
|
||||
ptr = getProc("glGetVertexAttribPointerv", userData); set_glGetVertexAttribPointerv((glGetVertexAttribPointerv_client_proc_t)ptr);
|
||||
ptr = getProc("glHint", userData); set_glHint((glHint_client_proc_t)ptr);
|
||||
ptr = getProc("glIsBuffer", userData); set_glIsBuffer((glIsBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glIsEnabled", userData); set_glIsEnabled((glIsEnabled_client_proc_t)ptr);
|
||||
ptr = getProc("glIsFramebuffer", userData); set_glIsFramebuffer((glIsFramebuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glIsProgram", userData); set_glIsProgram((glIsProgram_client_proc_t)ptr);
|
||||
ptr = getProc("glIsRenderbuffer", userData); set_glIsRenderbuffer((glIsRenderbuffer_client_proc_t)ptr);
|
||||
ptr = getProc("glIsShader", userData); set_glIsShader((glIsShader_client_proc_t)ptr);
|
||||
ptr = getProc("glIsTexture", userData); set_glIsTexture((glIsTexture_client_proc_t)ptr);
|
||||
ptr = getProc("glLineWidth", userData); set_glLineWidth((glLineWidth_client_proc_t)ptr);
|
||||
ptr = getProc("glLinkProgram", userData); set_glLinkProgram((glLinkProgram_client_proc_t)ptr);
|
||||
ptr = getProc("glPixelStorei", userData); set_glPixelStorei((glPixelStorei_client_proc_t)ptr);
|
||||
ptr = getProc("glPolygonOffset", userData); set_glPolygonOffset((glPolygonOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glReadPixels", userData); set_glReadPixels((glReadPixels_client_proc_t)ptr);
|
||||
ptr = getProc("glReleaseShaderCompiler", userData); set_glReleaseShaderCompiler((glReleaseShaderCompiler_client_proc_t)ptr);
|
||||
ptr = getProc("glRenderbufferStorage", userData); set_glRenderbufferStorage((glRenderbufferStorage_client_proc_t)ptr);
|
||||
ptr = getProc("glSampleCoverage", userData); set_glSampleCoverage((glSampleCoverage_client_proc_t)ptr);
|
||||
ptr = getProc("glScissor", userData); set_glScissor((glScissor_client_proc_t)ptr);
|
||||
ptr = getProc("glShaderBinary", userData); set_glShaderBinary((glShaderBinary_client_proc_t)ptr);
|
||||
ptr = getProc("glShaderSource", userData); set_glShaderSource((glShaderSource_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilFunc", userData); set_glStencilFunc((glStencilFunc_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilFuncSeparate", userData); set_glStencilFuncSeparate((glStencilFuncSeparate_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilMask", userData); set_glStencilMask((glStencilMask_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilMaskSeparate", userData); set_glStencilMaskSeparate((glStencilMaskSeparate_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilOp", userData); set_glStencilOp((glStencilOp_client_proc_t)ptr);
|
||||
ptr = getProc("glStencilOpSeparate", userData); set_glStencilOpSeparate((glStencilOpSeparate_client_proc_t)ptr);
|
||||
ptr = getProc("glTexImage2D", userData); set_glTexImage2D((glTexImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterf", userData); set_glTexParameterf((glTexParameterf_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameterfv", userData); set_glTexParameterfv((glTexParameterfv_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameteri", userData); set_glTexParameteri((glTexParameteri_client_proc_t)ptr);
|
||||
ptr = getProc("glTexParameteriv", userData); set_glTexParameteriv((glTexParameteriv_client_proc_t)ptr);
|
||||
ptr = getProc("glTexSubImage2D", userData); set_glTexSubImage2D((glTexSubImage2D_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform1f", userData); set_glUniform1f((glUniform1f_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform1fv", userData); set_glUniform1fv((glUniform1fv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform1i", userData); set_glUniform1i((glUniform1i_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform1iv", userData); set_glUniform1iv((glUniform1iv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform2f", userData); set_glUniform2f((glUniform2f_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform2fv", userData); set_glUniform2fv((glUniform2fv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform2i", userData); set_glUniform2i((glUniform2i_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform2iv", userData); set_glUniform2iv((glUniform2iv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform3f", userData); set_glUniform3f((glUniform3f_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform3fv", userData); set_glUniform3fv((glUniform3fv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform3i", userData); set_glUniform3i((glUniform3i_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform3iv", userData); set_glUniform3iv((glUniform3iv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform4f", userData); set_glUniform4f((glUniform4f_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform4fv", userData); set_glUniform4fv((glUniform4fv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform4i", userData); set_glUniform4i((glUniform4i_client_proc_t)ptr);
|
||||
ptr = getProc("glUniform4iv", userData); set_glUniform4iv((glUniform4iv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniformMatrix2fv", userData); set_glUniformMatrix2fv((glUniformMatrix2fv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniformMatrix3fv", userData); set_glUniformMatrix3fv((glUniformMatrix3fv_client_proc_t)ptr);
|
||||
ptr = getProc("glUniformMatrix4fv", userData); set_glUniformMatrix4fv((glUniformMatrix4fv_client_proc_t)ptr);
|
||||
ptr = getProc("glUseProgram", userData); set_glUseProgram((glUseProgram_client_proc_t)ptr);
|
||||
ptr = getProc("glValidateProgram", userData); set_glValidateProgram((glValidateProgram_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib1f", userData); set_glVertexAttrib1f((glVertexAttrib1f_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib1fv", userData); set_glVertexAttrib1fv((glVertexAttrib1fv_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib2f", userData); set_glVertexAttrib2f((glVertexAttrib2f_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib2fv", userData); set_glVertexAttrib2fv((glVertexAttrib2fv_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib3f", userData); set_glVertexAttrib3f((glVertexAttrib3f_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib3fv", userData); set_glVertexAttrib3fv((glVertexAttrib3fv_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib4f", userData); set_glVertexAttrib4f((glVertexAttrib4f_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttrib4fv", userData); set_glVertexAttrib4fv((glVertexAttrib4fv_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttribPointer", userData); set_glVertexAttribPointer((glVertexAttribPointer_client_proc_t)ptr);
|
||||
ptr = getProc("glViewport", userData); set_glViewport((glViewport_client_proc_t)ptr);
|
||||
ptr = getProc("glEGLImageTargetTexture2DOES", userData); set_glEGLImageTargetTexture2DOES((glEGLImageTargetTexture2DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glEGLImageTargetRenderbufferStorageOES", userData); set_glEGLImageTargetRenderbufferStorageOES((glEGLImageTargetRenderbufferStorageOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGetProgramBinaryOES", userData); set_glGetProgramBinaryOES((glGetProgramBinaryOES_client_proc_t)ptr);
|
||||
ptr = getProc("glProgramBinaryOES", userData); set_glProgramBinaryOES((glProgramBinaryOES_client_proc_t)ptr);
|
||||
ptr = getProc("glMapBufferOES", userData); set_glMapBufferOES((glMapBufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glUnmapBufferOES", userData); set_glUnmapBufferOES((glUnmapBufferOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexImage3DOES", userData); set_glTexImage3DOES((glTexImage3DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glTexSubImage3DOES", userData); set_glTexSubImage3DOES((glTexSubImage3DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glCopyTexSubImage3DOES", userData); set_glCopyTexSubImage3DOES((glCopyTexSubImage3DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glCompressedTexImage3DOES", userData); set_glCompressedTexImage3DOES((glCompressedTexImage3DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glCompressedTexSubImage3DOES", userData); set_glCompressedTexSubImage3DOES((glCompressedTexSubImage3DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glFramebufferTexture3DOES", userData); set_glFramebufferTexture3DOES((glFramebufferTexture3DOES_client_proc_t)ptr);
|
||||
ptr = getProc("glBindVertexArrayOES", userData); set_glBindVertexArrayOES((glBindVertexArrayOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteVertexArraysOES", userData); set_glDeleteVertexArraysOES((glDeleteVertexArraysOES_client_proc_t)ptr);
|
||||
ptr = getProc("glGenVertexArraysOES", userData); set_glGenVertexArraysOES((glGenVertexArraysOES_client_proc_t)ptr);
|
||||
ptr = getProc("glIsVertexArrayOES", userData); set_glIsVertexArrayOES((glIsVertexArrayOES_client_proc_t)ptr);
|
||||
ptr = getProc("glDiscardFramebufferEXT", userData); set_glDiscardFramebufferEXT((glDiscardFramebufferEXT_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiDrawArraysEXT", userData); set_glMultiDrawArraysEXT((glMultiDrawArraysEXT_client_proc_t)ptr);
|
||||
ptr = getProc("glMultiDrawElementsEXT", userData); set_glMultiDrawElementsEXT((glMultiDrawElementsEXT_client_proc_t)ptr);
|
||||
ptr = getProc("glGetPerfMonitorGroupsAMD", userData); set_glGetPerfMonitorGroupsAMD((glGetPerfMonitorGroupsAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glGetPerfMonitorCountersAMD", userData); set_glGetPerfMonitorCountersAMD((glGetPerfMonitorCountersAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glGetPerfMonitorGroupStringAMD", userData); set_glGetPerfMonitorGroupStringAMD((glGetPerfMonitorGroupStringAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glGetPerfMonitorCounterStringAMD", userData); set_glGetPerfMonitorCounterStringAMD((glGetPerfMonitorCounterStringAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glGetPerfMonitorCounterInfoAMD", userData); set_glGetPerfMonitorCounterInfoAMD((glGetPerfMonitorCounterInfoAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glGenPerfMonitorsAMD", userData); set_glGenPerfMonitorsAMD((glGenPerfMonitorsAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glDeletePerfMonitorsAMD", userData); set_glDeletePerfMonitorsAMD((glDeletePerfMonitorsAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glSelectPerfMonitorCountersAMD", userData); set_glSelectPerfMonitorCountersAMD((glSelectPerfMonitorCountersAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glBeginPerfMonitorAMD", userData); set_glBeginPerfMonitorAMD((glBeginPerfMonitorAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glEndPerfMonitorAMD", userData); set_glEndPerfMonitorAMD((glEndPerfMonitorAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glGetPerfMonitorCounterDataAMD", userData); set_glGetPerfMonitorCounterDataAMD((glGetPerfMonitorCounterDataAMD_client_proc_t)ptr);
|
||||
ptr = getProc("glRenderbufferStorageMultisampleIMG", userData); set_glRenderbufferStorageMultisampleIMG((glRenderbufferStorageMultisampleIMG_client_proc_t)ptr);
|
||||
ptr = getProc("glFramebufferTexture2DMultisampleIMG", userData); set_glFramebufferTexture2DMultisampleIMG((glFramebufferTexture2DMultisampleIMG_client_proc_t)ptr);
|
||||
ptr = getProc("glDeleteFencesNV", userData); set_glDeleteFencesNV((glDeleteFencesNV_client_proc_t)ptr);
|
||||
ptr = getProc("glGenFencesNV", userData); set_glGenFencesNV((glGenFencesNV_client_proc_t)ptr);
|
||||
ptr = getProc("glIsFenceNV", userData); set_glIsFenceNV((glIsFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glTestFenceNV", userData); set_glTestFenceNV((glTestFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glGetFenceivNV", userData); set_glGetFenceivNV((glGetFenceivNV_client_proc_t)ptr);
|
||||
ptr = getProc("glFinishFenceNV", userData); set_glFinishFenceNV((glFinishFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glSetFenceNV", userData); set_glSetFenceNV((glSetFenceNV_client_proc_t)ptr);
|
||||
ptr = getProc("glCoverageMaskNV", userData); set_glCoverageMaskNV((glCoverageMaskNV_client_proc_t)ptr);
|
||||
ptr = getProc("glCoverageOperationNV", userData); set_glCoverageOperationNV((glCoverageOperationNV_client_proc_t)ptr);
|
||||
ptr = getProc("glGetDriverControlsQCOM", userData); set_glGetDriverControlsQCOM((glGetDriverControlsQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glGetDriverControlStringQCOM", userData); set_glGetDriverControlStringQCOM((glGetDriverControlStringQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glEnableDriverControlQCOM", userData); set_glEnableDriverControlQCOM((glEnableDriverControlQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glDisableDriverControlQCOM", userData); set_glDisableDriverControlQCOM((glDisableDriverControlQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetTexturesQCOM", userData); set_glExtGetTexturesQCOM((glExtGetTexturesQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetBuffersQCOM", userData); set_glExtGetBuffersQCOM((glExtGetBuffersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetRenderbuffersQCOM", userData); set_glExtGetRenderbuffersQCOM((glExtGetRenderbuffersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetFramebuffersQCOM", userData); set_glExtGetFramebuffersQCOM((glExtGetFramebuffersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetTexLevelParameterivQCOM", userData); set_glExtGetTexLevelParameterivQCOM((glExtGetTexLevelParameterivQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtTexObjectStateOverrideiQCOM", userData); set_glExtTexObjectStateOverrideiQCOM((glExtTexObjectStateOverrideiQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetTexSubImageQCOM", userData); set_glExtGetTexSubImageQCOM((glExtGetTexSubImageQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetBufferPointervQCOM", userData); set_glExtGetBufferPointervQCOM((glExtGetBufferPointervQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetShadersQCOM", userData); set_glExtGetShadersQCOM((glExtGetShadersQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetProgramsQCOM", userData); set_glExtGetProgramsQCOM((glExtGetProgramsQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtIsProgramBinaryQCOM", userData); set_glExtIsProgramBinaryQCOM((glExtIsProgramBinaryQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glExtGetProgramBinarySourceQCOM", userData); set_glExtGetProgramBinarySourceQCOM((glExtGetProgramBinarySourceQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glStartTilingQCOM", userData); set_glStartTilingQCOM((glStartTilingQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glEndTilingQCOM", userData); set_glEndTilingQCOM((glEndTilingQCOM_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttribPointerData", userData); set_glVertexAttribPointerData((glVertexAttribPointerData_client_proc_t)ptr);
|
||||
ptr = getProc("glVertexAttribPointerOffset", userData); set_glVertexAttribPointerOffset((glVertexAttribPointerOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawElementsOffset", userData); set_glDrawElementsOffset((glDrawElementsOffset_client_proc_t)ptr);
|
||||
ptr = getProc("glDrawElementsData", userData); set_glDrawElementsData((glDrawElementsData_client_proc_t)ptr);
|
||||
ptr = getProc("glGetCompressedTextureFormats", userData); set_glGetCompressedTextureFormats((glGetCompressedTextureFormats_client_proc_t)ptr);
|
||||
ptr = getProc("glShaderString", userData); set_glShaderString((glShaderString_client_proc_t)ptr);
|
||||
ptr = getProc("glFinishRoundTrip", userData); set_glFinishRoundTrip((glFinishRoundTrip_client_proc_t)ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
437
tools/emulator/opengl/system/GLESv2_enc/gl2_client_context.h
Normal file
437
tools/emulator/opengl/system/GLESv2_enc/gl2_client_context.h
Normal file
@@ -0,0 +1,437 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __gl2_client_context_t_h
|
||||
#define __gl2_client_context_t_h
|
||||
|
||||
#include "gl2_client_proc.h"
|
||||
|
||||
|
||||
struct gl2_client_context_t {
|
||||
|
||||
glActiveTexture_client_proc_t glActiveTexture;
|
||||
glAttachShader_client_proc_t glAttachShader;
|
||||
glBindAttribLocation_client_proc_t glBindAttribLocation;
|
||||
glBindBuffer_client_proc_t glBindBuffer;
|
||||
glBindFramebuffer_client_proc_t glBindFramebuffer;
|
||||
glBindRenderbuffer_client_proc_t glBindRenderbuffer;
|
||||
glBindTexture_client_proc_t glBindTexture;
|
||||
glBlendColor_client_proc_t glBlendColor;
|
||||
glBlendEquation_client_proc_t glBlendEquation;
|
||||
glBlendEquationSeparate_client_proc_t glBlendEquationSeparate;
|
||||
glBlendFunc_client_proc_t glBlendFunc;
|
||||
glBlendFuncSeparate_client_proc_t glBlendFuncSeparate;
|
||||
glBufferData_client_proc_t glBufferData;
|
||||
glBufferSubData_client_proc_t glBufferSubData;
|
||||
glCheckFramebufferStatus_client_proc_t glCheckFramebufferStatus;
|
||||
glClear_client_proc_t glClear;
|
||||
glClearColor_client_proc_t glClearColor;
|
||||
glClearDepthf_client_proc_t glClearDepthf;
|
||||
glClearStencil_client_proc_t glClearStencil;
|
||||
glColorMask_client_proc_t glColorMask;
|
||||
glCompileShader_client_proc_t glCompileShader;
|
||||
glCompressedTexImage2D_client_proc_t glCompressedTexImage2D;
|
||||
glCompressedTexSubImage2D_client_proc_t glCompressedTexSubImage2D;
|
||||
glCopyTexImage2D_client_proc_t glCopyTexImage2D;
|
||||
glCopyTexSubImage2D_client_proc_t glCopyTexSubImage2D;
|
||||
glCreateProgram_client_proc_t glCreateProgram;
|
||||
glCreateShader_client_proc_t glCreateShader;
|
||||
glCullFace_client_proc_t glCullFace;
|
||||
glDeleteBuffers_client_proc_t glDeleteBuffers;
|
||||
glDeleteFramebuffers_client_proc_t glDeleteFramebuffers;
|
||||
glDeleteProgram_client_proc_t glDeleteProgram;
|
||||
glDeleteRenderbuffers_client_proc_t glDeleteRenderbuffers;
|
||||
glDeleteShader_client_proc_t glDeleteShader;
|
||||
glDeleteTextures_client_proc_t glDeleteTextures;
|
||||
glDepthFunc_client_proc_t glDepthFunc;
|
||||
glDepthMask_client_proc_t glDepthMask;
|
||||
glDepthRangef_client_proc_t glDepthRangef;
|
||||
glDetachShader_client_proc_t glDetachShader;
|
||||
glDisable_client_proc_t glDisable;
|
||||
glDisableVertexAttribArray_client_proc_t glDisableVertexAttribArray;
|
||||
glDrawArrays_client_proc_t glDrawArrays;
|
||||
glDrawElements_client_proc_t glDrawElements;
|
||||
glEnable_client_proc_t glEnable;
|
||||
glEnableVertexAttribArray_client_proc_t glEnableVertexAttribArray;
|
||||
glFinish_client_proc_t glFinish;
|
||||
glFlush_client_proc_t glFlush;
|
||||
glFramebufferRenderbuffer_client_proc_t glFramebufferRenderbuffer;
|
||||
glFramebufferTexture2D_client_proc_t glFramebufferTexture2D;
|
||||
glFrontFace_client_proc_t glFrontFace;
|
||||
glGenBuffers_client_proc_t glGenBuffers;
|
||||
glGenerateMipmap_client_proc_t glGenerateMipmap;
|
||||
glGenFramebuffers_client_proc_t glGenFramebuffers;
|
||||
glGenRenderbuffers_client_proc_t glGenRenderbuffers;
|
||||
glGenTextures_client_proc_t glGenTextures;
|
||||
glGetActiveAttrib_client_proc_t glGetActiveAttrib;
|
||||
glGetActiveUniform_client_proc_t glGetActiveUniform;
|
||||
glGetAttachedShaders_client_proc_t glGetAttachedShaders;
|
||||
glGetAttribLocation_client_proc_t glGetAttribLocation;
|
||||
glGetBooleanv_client_proc_t glGetBooleanv;
|
||||
glGetBufferParameteriv_client_proc_t glGetBufferParameteriv;
|
||||
glGetError_client_proc_t glGetError;
|
||||
glGetFloatv_client_proc_t glGetFloatv;
|
||||
glGetFramebufferAttachmentParameteriv_client_proc_t glGetFramebufferAttachmentParameteriv;
|
||||
glGetIntegerv_client_proc_t glGetIntegerv;
|
||||
glGetProgramiv_client_proc_t glGetProgramiv;
|
||||
glGetProgramInfoLog_client_proc_t glGetProgramInfoLog;
|
||||
glGetRenderbufferParameteriv_client_proc_t glGetRenderbufferParameteriv;
|
||||
glGetShaderiv_client_proc_t glGetShaderiv;
|
||||
glGetShaderInfoLog_client_proc_t glGetShaderInfoLog;
|
||||
glGetShaderPrecisionFormat_client_proc_t glGetShaderPrecisionFormat;
|
||||
glGetShaderSource_client_proc_t glGetShaderSource;
|
||||
glGetString_client_proc_t glGetString;
|
||||
glGetTexParameterfv_client_proc_t glGetTexParameterfv;
|
||||
glGetTexParameteriv_client_proc_t glGetTexParameteriv;
|
||||
glGetUniformfv_client_proc_t glGetUniformfv;
|
||||
glGetUniformiv_client_proc_t glGetUniformiv;
|
||||
glGetUniformLocation_client_proc_t glGetUniformLocation;
|
||||
glGetVertexAttribfv_client_proc_t glGetVertexAttribfv;
|
||||
glGetVertexAttribiv_client_proc_t glGetVertexAttribiv;
|
||||
glGetVertexAttribPointerv_client_proc_t glGetVertexAttribPointerv;
|
||||
glHint_client_proc_t glHint;
|
||||
glIsBuffer_client_proc_t glIsBuffer;
|
||||
glIsEnabled_client_proc_t glIsEnabled;
|
||||
glIsFramebuffer_client_proc_t glIsFramebuffer;
|
||||
glIsProgram_client_proc_t glIsProgram;
|
||||
glIsRenderbuffer_client_proc_t glIsRenderbuffer;
|
||||
glIsShader_client_proc_t glIsShader;
|
||||
glIsTexture_client_proc_t glIsTexture;
|
||||
glLineWidth_client_proc_t glLineWidth;
|
||||
glLinkProgram_client_proc_t glLinkProgram;
|
||||
glPixelStorei_client_proc_t glPixelStorei;
|
||||
glPolygonOffset_client_proc_t glPolygonOffset;
|
||||
glReadPixels_client_proc_t glReadPixels;
|
||||
glReleaseShaderCompiler_client_proc_t glReleaseShaderCompiler;
|
||||
glRenderbufferStorage_client_proc_t glRenderbufferStorage;
|
||||
glSampleCoverage_client_proc_t glSampleCoverage;
|
||||
glScissor_client_proc_t glScissor;
|
||||
glShaderBinary_client_proc_t glShaderBinary;
|
||||
glShaderSource_client_proc_t glShaderSource;
|
||||
glStencilFunc_client_proc_t glStencilFunc;
|
||||
glStencilFuncSeparate_client_proc_t glStencilFuncSeparate;
|
||||
glStencilMask_client_proc_t glStencilMask;
|
||||
glStencilMaskSeparate_client_proc_t glStencilMaskSeparate;
|
||||
glStencilOp_client_proc_t glStencilOp;
|
||||
glStencilOpSeparate_client_proc_t glStencilOpSeparate;
|
||||
glTexImage2D_client_proc_t glTexImage2D;
|
||||
glTexParameterf_client_proc_t glTexParameterf;
|
||||
glTexParameterfv_client_proc_t glTexParameterfv;
|
||||
glTexParameteri_client_proc_t glTexParameteri;
|
||||
glTexParameteriv_client_proc_t glTexParameteriv;
|
||||
glTexSubImage2D_client_proc_t glTexSubImage2D;
|
||||
glUniform1f_client_proc_t glUniform1f;
|
||||
glUniform1fv_client_proc_t glUniform1fv;
|
||||
glUniform1i_client_proc_t glUniform1i;
|
||||
glUniform1iv_client_proc_t glUniform1iv;
|
||||
glUniform2f_client_proc_t glUniform2f;
|
||||
glUniform2fv_client_proc_t glUniform2fv;
|
||||
glUniform2i_client_proc_t glUniform2i;
|
||||
glUniform2iv_client_proc_t glUniform2iv;
|
||||
glUniform3f_client_proc_t glUniform3f;
|
||||
glUniform3fv_client_proc_t glUniform3fv;
|
||||
glUniform3i_client_proc_t glUniform3i;
|
||||
glUniform3iv_client_proc_t glUniform3iv;
|
||||
glUniform4f_client_proc_t glUniform4f;
|
||||
glUniform4fv_client_proc_t glUniform4fv;
|
||||
glUniform4i_client_proc_t glUniform4i;
|
||||
glUniform4iv_client_proc_t glUniform4iv;
|
||||
glUniformMatrix2fv_client_proc_t glUniformMatrix2fv;
|
||||
glUniformMatrix3fv_client_proc_t glUniformMatrix3fv;
|
||||
glUniformMatrix4fv_client_proc_t glUniformMatrix4fv;
|
||||
glUseProgram_client_proc_t glUseProgram;
|
||||
glValidateProgram_client_proc_t glValidateProgram;
|
||||
glVertexAttrib1f_client_proc_t glVertexAttrib1f;
|
||||
glVertexAttrib1fv_client_proc_t glVertexAttrib1fv;
|
||||
glVertexAttrib2f_client_proc_t glVertexAttrib2f;
|
||||
glVertexAttrib2fv_client_proc_t glVertexAttrib2fv;
|
||||
glVertexAttrib3f_client_proc_t glVertexAttrib3f;
|
||||
glVertexAttrib3fv_client_proc_t glVertexAttrib3fv;
|
||||
glVertexAttrib4f_client_proc_t glVertexAttrib4f;
|
||||
glVertexAttrib4fv_client_proc_t glVertexAttrib4fv;
|
||||
glVertexAttribPointer_client_proc_t glVertexAttribPointer;
|
||||
glViewport_client_proc_t glViewport;
|
||||
glEGLImageTargetTexture2DOES_client_proc_t glEGLImageTargetTexture2DOES;
|
||||
glEGLImageTargetRenderbufferStorageOES_client_proc_t glEGLImageTargetRenderbufferStorageOES;
|
||||
glGetProgramBinaryOES_client_proc_t glGetProgramBinaryOES;
|
||||
glProgramBinaryOES_client_proc_t glProgramBinaryOES;
|
||||
glMapBufferOES_client_proc_t glMapBufferOES;
|
||||
glUnmapBufferOES_client_proc_t glUnmapBufferOES;
|
||||
glTexImage3DOES_client_proc_t glTexImage3DOES;
|
||||
glTexSubImage3DOES_client_proc_t glTexSubImage3DOES;
|
||||
glCopyTexSubImage3DOES_client_proc_t glCopyTexSubImage3DOES;
|
||||
glCompressedTexImage3DOES_client_proc_t glCompressedTexImage3DOES;
|
||||
glCompressedTexSubImage3DOES_client_proc_t glCompressedTexSubImage3DOES;
|
||||
glFramebufferTexture3DOES_client_proc_t glFramebufferTexture3DOES;
|
||||
glBindVertexArrayOES_client_proc_t glBindVertexArrayOES;
|
||||
glDeleteVertexArraysOES_client_proc_t glDeleteVertexArraysOES;
|
||||
glGenVertexArraysOES_client_proc_t glGenVertexArraysOES;
|
||||
glIsVertexArrayOES_client_proc_t glIsVertexArrayOES;
|
||||
glDiscardFramebufferEXT_client_proc_t glDiscardFramebufferEXT;
|
||||
glMultiDrawArraysEXT_client_proc_t glMultiDrawArraysEXT;
|
||||
glMultiDrawElementsEXT_client_proc_t glMultiDrawElementsEXT;
|
||||
glGetPerfMonitorGroupsAMD_client_proc_t glGetPerfMonitorGroupsAMD;
|
||||
glGetPerfMonitorCountersAMD_client_proc_t glGetPerfMonitorCountersAMD;
|
||||
glGetPerfMonitorGroupStringAMD_client_proc_t glGetPerfMonitorGroupStringAMD;
|
||||
glGetPerfMonitorCounterStringAMD_client_proc_t glGetPerfMonitorCounterStringAMD;
|
||||
glGetPerfMonitorCounterInfoAMD_client_proc_t glGetPerfMonitorCounterInfoAMD;
|
||||
glGenPerfMonitorsAMD_client_proc_t glGenPerfMonitorsAMD;
|
||||
glDeletePerfMonitorsAMD_client_proc_t glDeletePerfMonitorsAMD;
|
||||
glSelectPerfMonitorCountersAMD_client_proc_t glSelectPerfMonitorCountersAMD;
|
||||
glBeginPerfMonitorAMD_client_proc_t glBeginPerfMonitorAMD;
|
||||
glEndPerfMonitorAMD_client_proc_t glEndPerfMonitorAMD;
|
||||
glGetPerfMonitorCounterDataAMD_client_proc_t glGetPerfMonitorCounterDataAMD;
|
||||
glRenderbufferStorageMultisampleIMG_client_proc_t glRenderbufferStorageMultisampleIMG;
|
||||
glFramebufferTexture2DMultisampleIMG_client_proc_t glFramebufferTexture2DMultisampleIMG;
|
||||
glDeleteFencesNV_client_proc_t glDeleteFencesNV;
|
||||
glGenFencesNV_client_proc_t glGenFencesNV;
|
||||
glIsFenceNV_client_proc_t glIsFenceNV;
|
||||
glTestFenceNV_client_proc_t glTestFenceNV;
|
||||
glGetFenceivNV_client_proc_t glGetFenceivNV;
|
||||
glFinishFenceNV_client_proc_t glFinishFenceNV;
|
||||
glSetFenceNV_client_proc_t glSetFenceNV;
|
||||
glCoverageMaskNV_client_proc_t glCoverageMaskNV;
|
||||
glCoverageOperationNV_client_proc_t glCoverageOperationNV;
|
||||
glGetDriverControlsQCOM_client_proc_t glGetDriverControlsQCOM;
|
||||
glGetDriverControlStringQCOM_client_proc_t glGetDriverControlStringQCOM;
|
||||
glEnableDriverControlQCOM_client_proc_t glEnableDriverControlQCOM;
|
||||
glDisableDriverControlQCOM_client_proc_t glDisableDriverControlQCOM;
|
||||
glExtGetTexturesQCOM_client_proc_t glExtGetTexturesQCOM;
|
||||
glExtGetBuffersQCOM_client_proc_t glExtGetBuffersQCOM;
|
||||
glExtGetRenderbuffersQCOM_client_proc_t glExtGetRenderbuffersQCOM;
|
||||
glExtGetFramebuffersQCOM_client_proc_t glExtGetFramebuffersQCOM;
|
||||
glExtGetTexLevelParameterivQCOM_client_proc_t glExtGetTexLevelParameterivQCOM;
|
||||
glExtTexObjectStateOverrideiQCOM_client_proc_t glExtTexObjectStateOverrideiQCOM;
|
||||
glExtGetTexSubImageQCOM_client_proc_t glExtGetTexSubImageQCOM;
|
||||
glExtGetBufferPointervQCOM_client_proc_t glExtGetBufferPointervQCOM;
|
||||
glExtGetShadersQCOM_client_proc_t glExtGetShadersQCOM;
|
||||
glExtGetProgramsQCOM_client_proc_t glExtGetProgramsQCOM;
|
||||
glExtIsProgramBinaryQCOM_client_proc_t glExtIsProgramBinaryQCOM;
|
||||
glExtGetProgramBinarySourceQCOM_client_proc_t glExtGetProgramBinarySourceQCOM;
|
||||
glStartTilingQCOM_client_proc_t glStartTilingQCOM;
|
||||
glEndTilingQCOM_client_proc_t glEndTilingQCOM;
|
||||
glVertexAttribPointerData_client_proc_t glVertexAttribPointerData;
|
||||
glVertexAttribPointerOffset_client_proc_t glVertexAttribPointerOffset;
|
||||
glDrawElementsOffset_client_proc_t glDrawElementsOffset;
|
||||
glDrawElementsData_client_proc_t glDrawElementsData;
|
||||
glGetCompressedTextureFormats_client_proc_t glGetCompressedTextureFormats;
|
||||
glShaderString_client_proc_t glShaderString;
|
||||
glFinishRoundTrip_client_proc_t glFinishRoundTrip;
|
||||
//Accessors
|
||||
virtual glActiveTexture_client_proc_t set_glActiveTexture(glActiveTexture_client_proc_t f) { glActiveTexture_client_proc_t retval = glActiveTexture; glActiveTexture = f; return retval;}
|
||||
virtual glAttachShader_client_proc_t set_glAttachShader(glAttachShader_client_proc_t f) { glAttachShader_client_proc_t retval = glAttachShader; glAttachShader = f; return retval;}
|
||||
virtual glBindAttribLocation_client_proc_t set_glBindAttribLocation(glBindAttribLocation_client_proc_t f) { glBindAttribLocation_client_proc_t retval = glBindAttribLocation; glBindAttribLocation = f; return retval;}
|
||||
virtual glBindBuffer_client_proc_t set_glBindBuffer(glBindBuffer_client_proc_t f) { glBindBuffer_client_proc_t retval = glBindBuffer; glBindBuffer = f; return retval;}
|
||||
virtual glBindFramebuffer_client_proc_t set_glBindFramebuffer(glBindFramebuffer_client_proc_t f) { glBindFramebuffer_client_proc_t retval = glBindFramebuffer; glBindFramebuffer = f; return retval;}
|
||||
virtual glBindRenderbuffer_client_proc_t set_glBindRenderbuffer(glBindRenderbuffer_client_proc_t f) { glBindRenderbuffer_client_proc_t retval = glBindRenderbuffer; glBindRenderbuffer = f; return retval;}
|
||||
virtual glBindTexture_client_proc_t set_glBindTexture(glBindTexture_client_proc_t f) { glBindTexture_client_proc_t retval = glBindTexture; glBindTexture = f; return retval;}
|
||||
virtual glBlendColor_client_proc_t set_glBlendColor(glBlendColor_client_proc_t f) { glBlendColor_client_proc_t retval = glBlendColor; glBlendColor = f; return retval;}
|
||||
virtual glBlendEquation_client_proc_t set_glBlendEquation(glBlendEquation_client_proc_t f) { glBlendEquation_client_proc_t retval = glBlendEquation; glBlendEquation = f; return retval;}
|
||||
virtual glBlendEquationSeparate_client_proc_t set_glBlendEquationSeparate(glBlendEquationSeparate_client_proc_t f) { glBlendEquationSeparate_client_proc_t retval = glBlendEquationSeparate; glBlendEquationSeparate = f; return retval;}
|
||||
virtual glBlendFunc_client_proc_t set_glBlendFunc(glBlendFunc_client_proc_t f) { glBlendFunc_client_proc_t retval = glBlendFunc; glBlendFunc = f; return retval;}
|
||||
virtual glBlendFuncSeparate_client_proc_t set_glBlendFuncSeparate(glBlendFuncSeparate_client_proc_t f) { glBlendFuncSeparate_client_proc_t retval = glBlendFuncSeparate; glBlendFuncSeparate = f; return retval;}
|
||||
virtual glBufferData_client_proc_t set_glBufferData(glBufferData_client_proc_t f) { glBufferData_client_proc_t retval = glBufferData; glBufferData = f; return retval;}
|
||||
virtual glBufferSubData_client_proc_t set_glBufferSubData(glBufferSubData_client_proc_t f) { glBufferSubData_client_proc_t retval = glBufferSubData; glBufferSubData = f; return retval;}
|
||||
virtual glCheckFramebufferStatus_client_proc_t set_glCheckFramebufferStatus(glCheckFramebufferStatus_client_proc_t f) { glCheckFramebufferStatus_client_proc_t retval = glCheckFramebufferStatus; glCheckFramebufferStatus = f; return retval;}
|
||||
virtual glClear_client_proc_t set_glClear(glClear_client_proc_t f) { glClear_client_proc_t retval = glClear; glClear = f; return retval;}
|
||||
virtual glClearColor_client_proc_t set_glClearColor(glClearColor_client_proc_t f) { glClearColor_client_proc_t retval = glClearColor; glClearColor = f; return retval;}
|
||||
virtual glClearDepthf_client_proc_t set_glClearDepthf(glClearDepthf_client_proc_t f) { glClearDepthf_client_proc_t retval = glClearDepthf; glClearDepthf = f; return retval;}
|
||||
virtual glClearStencil_client_proc_t set_glClearStencil(glClearStencil_client_proc_t f) { glClearStencil_client_proc_t retval = glClearStencil; glClearStencil = f; return retval;}
|
||||
virtual glColorMask_client_proc_t set_glColorMask(glColorMask_client_proc_t f) { glColorMask_client_proc_t retval = glColorMask; glColorMask = f; return retval;}
|
||||
virtual glCompileShader_client_proc_t set_glCompileShader(glCompileShader_client_proc_t f) { glCompileShader_client_proc_t retval = glCompileShader; glCompileShader = f; return retval;}
|
||||
virtual glCompressedTexImage2D_client_proc_t set_glCompressedTexImage2D(glCompressedTexImage2D_client_proc_t f) { glCompressedTexImage2D_client_proc_t retval = glCompressedTexImage2D; glCompressedTexImage2D = f; return retval;}
|
||||
virtual glCompressedTexSubImage2D_client_proc_t set_glCompressedTexSubImage2D(glCompressedTexSubImage2D_client_proc_t f) { glCompressedTexSubImage2D_client_proc_t retval = glCompressedTexSubImage2D; glCompressedTexSubImage2D = f; return retval;}
|
||||
virtual glCopyTexImage2D_client_proc_t set_glCopyTexImage2D(glCopyTexImage2D_client_proc_t f) { glCopyTexImage2D_client_proc_t retval = glCopyTexImage2D; glCopyTexImage2D = f; return retval;}
|
||||
virtual glCopyTexSubImage2D_client_proc_t set_glCopyTexSubImage2D(glCopyTexSubImage2D_client_proc_t f) { glCopyTexSubImage2D_client_proc_t retval = glCopyTexSubImage2D; glCopyTexSubImage2D = f; return retval;}
|
||||
virtual glCreateProgram_client_proc_t set_glCreateProgram(glCreateProgram_client_proc_t f) { glCreateProgram_client_proc_t retval = glCreateProgram; glCreateProgram = f; return retval;}
|
||||
virtual glCreateShader_client_proc_t set_glCreateShader(glCreateShader_client_proc_t f) { glCreateShader_client_proc_t retval = glCreateShader; glCreateShader = f; return retval;}
|
||||
virtual glCullFace_client_proc_t set_glCullFace(glCullFace_client_proc_t f) { glCullFace_client_proc_t retval = glCullFace; glCullFace = f; return retval;}
|
||||
virtual glDeleteBuffers_client_proc_t set_glDeleteBuffers(glDeleteBuffers_client_proc_t f) { glDeleteBuffers_client_proc_t retval = glDeleteBuffers; glDeleteBuffers = f; return retval;}
|
||||
virtual glDeleteFramebuffers_client_proc_t set_glDeleteFramebuffers(glDeleteFramebuffers_client_proc_t f) { glDeleteFramebuffers_client_proc_t retval = glDeleteFramebuffers; glDeleteFramebuffers = f; return retval;}
|
||||
virtual glDeleteProgram_client_proc_t set_glDeleteProgram(glDeleteProgram_client_proc_t f) { glDeleteProgram_client_proc_t retval = glDeleteProgram; glDeleteProgram = f; return retval;}
|
||||
virtual glDeleteRenderbuffers_client_proc_t set_glDeleteRenderbuffers(glDeleteRenderbuffers_client_proc_t f) { glDeleteRenderbuffers_client_proc_t retval = glDeleteRenderbuffers; glDeleteRenderbuffers = f; return retval;}
|
||||
virtual glDeleteShader_client_proc_t set_glDeleteShader(glDeleteShader_client_proc_t f) { glDeleteShader_client_proc_t retval = glDeleteShader; glDeleteShader = f; return retval;}
|
||||
virtual glDeleteTextures_client_proc_t set_glDeleteTextures(glDeleteTextures_client_proc_t f) { glDeleteTextures_client_proc_t retval = glDeleteTextures; glDeleteTextures = f; return retval;}
|
||||
virtual glDepthFunc_client_proc_t set_glDepthFunc(glDepthFunc_client_proc_t f) { glDepthFunc_client_proc_t retval = glDepthFunc; glDepthFunc = f; return retval;}
|
||||
virtual glDepthMask_client_proc_t set_glDepthMask(glDepthMask_client_proc_t f) { glDepthMask_client_proc_t retval = glDepthMask; glDepthMask = f; return retval;}
|
||||
virtual glDepthRangef_client_proc_t set_glDepthRangef(glDepthRangef_client_proc_t f) { glDepthRangef_client_proc_t retval = glDepthRangef; glDepthRangef = f; return retval;}
|
||||
virtual glDetachShader_client_proc_t set_glDetachShader(glDetachShader_client_proc_t f) { glDetachShader_client_proc_t retval = glDetachShader; glDetachShader = f; return retval;}
|
||||
virtual glDisable_client_proc_t set_glDisable(glDisable_client_proc_t f) { glDisable_client_proc_t retval = glDisable; glDisable = f; return retval;}
|
||||
virtual glDisableVertexAttribArray_client_proc_t set_glDisableVertexAttribArray(glDisableVertexAttribArray_client_proc_t f) { glDisableVertexAttribArray_client_proc_t retval = glDisableVertexAttribArray; glDisableVertexAttribArray = f; return retval;}
|
||||
virtual glDrawArrays_client_proc_t set_glDrawArrays(glDrawArrays_client_proc_t f) { glDrawArrays_client_proc_t retval = glDrawArrays; glDrawArrays = f; return retval;}
|
||||
virtual glDrawElements_client_proc_t set_glDrawElements(glDrawElements_client_proc_t f) { glDrawElements_client_proc_t retval = glDrawElements; glDrawElements = f; return retval;}
|
||||
virtual glEnable_client_proc_t set_glEnable(glEnable_client_proc_t f) { glEnable_client_proc_t retval = glEnable; glEnable = f; return retval;}
|
||||
virtual glEnableVertexAttribArray_client_proc_t set_glEnableVertexAttribArray(glEnableVertexAttribArray_client_proc_t f) { glEnableVertexAttribArray_client_proc_t retval = glEnableVertexAttribArray; glEnableVertexAttribArray = f; return retval;}
|
||||
virtual glFinish_client_proc_t set_glFinish(glFinish_client_proc_t f) { glFinish_client_proc_t retval = glFinish; glFinish = f; return retval;}
|
||||
virtual glFlush_client_proc_t set_glFlush(glFlush_client_proc_t f) { glFlush_client_proc_t retval = glFlush; glFlush = f; return retval;}
|
||||
virtual glFramebufferRenderbuffer_client_proc_t set_glFramebufferRenderbuffer(glFramebufferRenderbuffer_client_proc_t f) { glFramebufferRenderbuffer_client_proc_t retval = glFramebufferRenderbuffer; glFramebufferRenderbuffer = f; return retval;}
|
||||
virtual glFramebufferTexture2D_client_proc_t set_glFramebufferTexture2D(glFramebufferTexture2D_client_proc_t f) { glFramebufferTexture2D_client_proc_t retval = glFramebufferTexture2D; glFramebufferTexture2D = f; return retval;}
|
||||
virtual glFrontFace_client_proc_t set_glFrontFace(glFrontFace_client_proc_t f) { glFrontFace_client_proc_t retval = glFrontFace; glFrontFace = f; return retval;}
|
||||
virtual glGenBuffers_client_proc_t set_glGenBuffers(glGenBuffers_client_proc_t f) { glGenBuffers_client_proc_t retval = glGenBuffers; glGenBuffers = f; return retval;}
|
||||
virtual glGenerateMipmap_client_proc_t set_glGenerateMipmap(glGenerateMipmap_client_proc_t f) { glGenerateMipmap_client_proc_t retval = glGenerateMipmap; glGenerateMipmap = f; return retval;}
|
||||
virtual glGenFramebuffers_client_proc_t set_glGenFramebuffers(glGenFramebuffers_client_proc_t f) { glGenFramebuffers_client_proc_t retval = glGenFramebuffers; glGenFramebuffers = f; return retval;}
|
||||
virtual glGenRenderbuffers_client_proc_t set_glGenRenderbuffers(glGenRenderbuffers_client_proc_t f) { glGenRenderbuffers_client_proc_t retval = glGenRenderbuffers; glGenRenderbuffers = f; return retval;}
|
||||
virtual glGenTextures_client_proc_t set_glGenTextures(glGenTextures_client_proc_t f) { glGenTextures_client_proc_t retval = glGenTextures; glGenTextures = f; return retval;}
|
||||
virtual glGetActiveAttrib_client_proc_t set_glGetActiveAttrib(glGetActiveAttrib_client_proc_t f) { glGetActiveAttrib_client_proc_t retval = glGetActiveAttrib; glGetActiveAttrib = f; return retval;}
|
||||
virtual glGetActiveUniform_client_proc_t set_glGetActiveUniform(glGetActiveUniform_client_proc_t f) { glGetActiveUniform_client_proc_t retval = glGetActiveUniform; glGetActiveUniform = f; return retval;}
|
||||
virtual glGetAttachedShaders_client_proc_t set_glGetAttachedShaders(glGetAttachedShaders_client_proc_t f) { glGetAttachedShaders_client_proc_t retval = glGetAttachedShaders; glGetAttachedShaders = f; return retval;}
|
||||
virtual glGetAttribLocation_client_proc_t set_glGetAttribLocation(glGetAttribLocation_client_proc_t f) { glGetAttribLocation_client_proc_t retval = glGetAttribLocation; glGetAttribLocation = f; return retval;}
|
||||
virtual glGetBooleanv_client_proc_t set_glGetBooleanv(glGetBooleanv_client_proc_t f) { glGetBooleanv_client_proc_t retval = glGetBooleanv; glGetBooleanv = f; return retval;}
|
||||
virtual glGetBufferParameteriv_client_proc_t set_glGetBufferParameteriv(glGetBufferParameteriv_client_proc_t f) { glGetBufferParameteriv_client_proc_t retval = glGetBufferParameteriv; glGetBufferParameteriv = f; return retval;}
|
||||
virtual glGetError_client_proc_t set_glGetError(glGetError_client_proc_t f) { glGetError_client_proc_t retval = glGetError; glGetError = f; return retval;}
|
||||
virtual glGetFloatv_client_proc_t set_glGetFloatv(glGetFloatv_client_proc_t f) { glGetFloatv_client_proc_t retval = glGetFloatv; glGetFloatv = f; return retval;}
|
||||
virtual glGetFramebufferAttachmentParameteriv_client_proc_t set_glGetFramebufferAttachmentParameteriv(glGetFramebufferAttachmentParameteriv_client_proc_t f) { glGetFramebufferAttachmentParameteriv_client_proc_t retval = glGetFramebufferAttachmentParameteriv; glGetFramebufferAttachmentParameteriv = f; return retval;}
|
||||
virtual glGetIntegerv_client_proc_t set_glGetIntegerv(glGetIntegerv_client_proc_t f) { glGetIntegerv_client_proc_t retval = glGetIntegerv; glGetIntegerv = f; return retval;}
|
||||
virtual glGetProgramiv_client_proc_t set_glGetProgramiv(glGetProgramiv_client_proc_t f) { glGetProgramiv_client_proc_t retval = glGetProgramiv; glGetProgramiv = f; return retval;}
|
||||
virtual glGetProgramInfoLog_client_proc_t set_glGetProgramInfoLog(glGetProgramInfoLog_client_proc_t f) { glGetProgramInfoLog_client_proc_t retval = glGetProgramInfoLog; glGetProgramInfoLog = f; return retval;}
|
||||
virtual glGetRenderbufferParameteriv_client_proc_t set_glGetRenderbufferParameteriv(glGetRenderbufferParameteriv_client_proc_t f) { glGetRenderbufferParameteriv_client_proc_t retval = glGetRenderbufferParameteriv; glGetRenderbufferParameteriv = f; return retval;}
|
||||
virtual glGetShaderiv_client_proc_t set_glGetShaderiv(glGetShaderiv_client_proc_t f) { glGetShaderiv_client_proc_t retval = glGetShaderiv; glGetShaderiv = f; return retval;}
|
||||
virtual glGetShaderInfoLog_client_proc_t set_glGetShaderInfoLog(glGetShaderInfoLog_client_proc_t f) { glGetShaderInfoLog_client_proc_t retval = glGetShaderInfoLog; glGetShaderInfoLog = f; return retval;}
|
||||
virtual glGetShaderPrecisionFormat_client_proc_t set_glGetShaderPrecisionFormat(glGetShaderPrecisionFormat_client_proc_t f) { glGetShaderPrecisionFormat_client_proc_t retval = glGetShaderPrecisionFormat; glGetShaderPrecisionFormat = f; return retval;}
|
||||
virtual glGetShaderSource_client_proc_t set_glGetShaderSource(glGetShaderSource_client_proc_t f) { glGetShaderSource_client_proc_t retval = glGetShaderSource; glGetShaderSource = f; return retval;}
|
||||
virtual glGetString_client_proc_t set_glGetString(glGetString_client_proc_t f) { glGetString_client_proc_t retval = glGetString; glGetString = f; return retval;}
|
||||
virtual glGetTexParameterfv_client_proc_t set_glGetTexParameterfv(glGetTexParameterfv_client_proc_t f) { glGetTexParameterfv_client_proc_t retval = glGetTexParameterfv; glGetTexParameterfv = f; return retval;}
|
||||
virtual glGetTexParameteriv_client_proc_t set_glGetTexParameteriv(glGetTexParameteriv_client_proc_t f) { glGetTexParameteriv_client_proc_t retval = glGetTexParameteriv; glGetTexParameteriv = f; return retval;}
|
||||
virtual glGetUniformfv_client_proc_t set_glGetUniformfv(glGetUniformfv_client_proc_t f) { glGetUniformfv_client_proc_t retval = glGetUniformfv; glGetUniformfv = f; return retval;}
|
||||
virtual glGetUniformiv_client_proc_t set_glGetUniformiv(glGetUniformiv_client_proc_t f) { glGetUniformiv_client_proc_t retval = glGetUniformiv; glGetUniformiv = f; return retval;}
|
||||
virtual glGetUniformLocation_client_proc_t set_glGetUniformLocation(glGetUniformLocation_client_proc_t f) { glGetUniformLocation_client_proc_t retval = glGetUniformLocation; glGetUniformLocation = f; return retval;}
|
||||
virtual glGetVertexAttribfv_client_proc_t set_glGetVertexAttribfv(glGetVertexAttribfv_client_proc_t f) { glGetVertexAttribfv_client_proc_t retval = glGetVertexAttribfv; glGetVertexAttribfv = f; return retval;}
|
||||
virtual glGetVertexAttribiv_client_proc_t set_glGetVertexAttribiv(glGetVertexAttribiv_client_proc_t f) { glGetVertexAttribiv_client_proc_t retval = glGetVertexAttribiv; glGetVertexAttribiv = f; return retval;}
|
||||
virtual glGetVertexAttribPointerv_client_proc_t set_glGetVertexAttribPointerv(glGetVertexAttribPointerv_client_proc_t f) { glGetVertexAttribPointerv_client_proc_t retval = glGetVertexAttribPointerv; glGetVertexAttribPointerv = f; return retval;}
|
||||
virtual glHint_client_proc_t set_glHint(glHint_client_proc_t f) { glHint_client_proc_t retval = glHint; glHint = f; return retval;}
|
||||
virtual glIsBuffer_client_proc_t set_glIsBuffer(glIsBuffer_client_proc_t f) { glIsBuffer_client_proc_t retval = glIsBuffer; glIsBuffer = f; return retval;}
|
||||
virtual glIsEnabled_client_proc_t set_glIsEnabled(glIsEnabled_client_proc_t f) { glIsEnabled_client_proc_t retval = glIsEnabled; glIsEnabled = f; return retval;}
|
||||
virtual glIsFramebuffer_client_proc_t set_glIsFramebuffer(glIsFramebuffer_client_proc_t f) { glIsFramebuffer_client_proc_t retval = glIsFramebuffer; glIsFramebuffer = f; return retval;}
|
||||
virtual glIsProgram_client_proc_t set_glIsProgram(glIsProgram_client_proc_t f) { glIsProgram_client_proc_t retval = glIsProgram; glIsProgram = f; return retval;}
|
||||
virtual glIsRenderbuffer_client_proc_t set_glIsRenderbuffer(glIsRenderbuffer_client_proc_t f) { glIsRenderbuffer_client_proc_t retval = glIsRenderbuffer; glIsRenderbuffer = f; return retval;}
|
||||
virtual glIsShader_client_proc_t set_glIsShader(glIsShader_client_proc_t f) { glIsShader_client_proc_t retval = glIsShader; glIsShader = f; return retval;}
|
||||
virtual glIsTexture_client_proc_t set_glIsTexture(glIsTexture_client_proc_t f) { glIsTexture_client_proc_t retval = glIsTexture; glIsTexture = f; return retval;}
|
||||
virtual glLineWidth_client_proc_t set_glLineWidth(glLineWidth_client_proc_t f) { glLineWidth_client_proc_t retval = glLineWidth; glLineWidth = f; return retval;}
|
||||
virtual glLinkProgram_client_proc_t set_glLinkProgram(glLinkProgram_client_proc_t f) { glLinkProgram_client_proc_t retval = glLinkProgram; glLinkProgram = f; return retval;}
|
||||
virtual glPixelStorei_client_proc_t set_glPixelStorei(glPixelStorei_client_proc_t f) { glPixelStorei_client_proc_t retval = glPixelStorei; glPixelStorei = f; return retval;}
|
||||
virtual glPolygonOffset_client_proc_t set_glPolygonOffset(glPolygonOffset_client_proc_t f) { glPolygonOffset_client_proc_t retval = glPolygonOffset; glPolygonOffset = f; return retval;}
|
||||
virtual glReadPixels_client_proc_t set_glReadPixels(glReadPixels_client_proc_t f) { glReadPixels_client_proc_t retval = glReadPixels; glReadPixels = f; return retval;}
|
||||
virtual glReleaseShaderCompiler_client_proc_t set_glReleaseShaderCompiler(glReleaseShaderCompiler_client_proc_t f) { glReleaseShaderCompiler_client_proc_t retval = glReleaseShaderCompiler; glReleaseShaderCompiler = f; return retval;}
|
||||
virtual glRenderbufferStorage_client_proc_t set_glRenderbufferStorage(glRenderbufferStorage_client_proc_t f) { glRenderbufferStorage_client_proc_t retval = glRenderbufferStorage; glRenderbufferStorage = f; return retval;}
|
||||
virtual glSampleCoverage_client_proc_t set_glSampleCoverage(glSampleCoverage_client_proc_t f) { glSampleCoverage_client_proc_t retval = glSampleCoverage; glSampleCoverage = f; return retval;}
|
||||
virtual glScissor_client_proc_t set_glScissor(glScissor_client_proc_t f) { glScissor_client_proc_t retval = glScissor; glScissor = f; return retval;}
|
||||
virtual glShaderBinary_client_proc_t set_glShaderBinary(glShaderBinary_client_proc_t f) { glShaderBinary_client_proc_t retval = glShaderBinary; glShaderBinary = f; return retval;}
|
||||
virtual glShaderSource_client_proc_t set_glShaderSource(glShaderSource_client_proc_t f) { glShaderSource_client_proc_t retval = glShaderSource; glShaderSource = f; return retval;}
|
||||
virtual glStencilFunc_client_proc_t set_glStencilFunc(glStencilFunc_client_proc_t f) { glStencilFunc_client_proc_t retval = glStencilFunc; glStencilFunc = f; return retval;}
|
||||
virtual glStencilFuncSeparate_client_proc_t set_glStencilFuncSeparate(glStencilFuncSeparate_client_proc_t f) { glStencilFuncSeparate_client_proc_t retval = glStencilFuncSeparate; glStencilFuncSeparate = f; return retval;}
|
||||
virtual glStencilMask_client_proc_t set_glStencilMask(glStencilMask_client_proc_t f) { glStencilMask_client_proc_t retval = glStencilMask; glStencilMask = f; return retval;}
|
||||
virtual glStencilMaskSeparate_client_proc_t set_glStencilMaskSeparate(glStencilMaskSeparate_client_proc_t f) { glStencilMaskSeparate_client_proc_t retval = glStencilMaskSeparate; glStencilMaskSeparate = f; return retval;}
|
||||
virtual glStencilOp_client_proc_t set_glStencilOp(glStencilOp_client_proc_t f) { glStencilOp_client_proc_t retval = glStencilOp; glStencilOp = f; return retval;}
|
||||
virtual glStencilOpSeparate_client_proc_t set_glStencilOpSeparate(glStencilOpSeparate_client_proc_t f) { glStencilOpSeparate_client_proc_t retval = glStencilOpSeparate; glStencilOpSeparate = f; return retval;}
|
||||
virtual glTexImage2D_client_proc_t set_glTexImage2D(glTexImage2D_client_proc_t f) { glTexImage2D_client_proc_t retval = glTexImage2D; glTexImage2D = f; return retval;}
|
||||
virtual glTexParameterf_client_proc_t set_glTexParameterf(glTexParameterf_client_proc_t f) { glTexParameterf_client_proc_t retval = glTexParameterf; glTexParameterf = f; return retval;}
|
||||
virtual glTexParameterfv_client_proc_t set_glTexParameterfv(glTexParameterfv_client_proc_t f) { glTexParameterfv_client_proc_t retval = glTexParameterfv; glTexParameterfv = f; return retval;}
|
||||
virtual glTexParameteri_client_proc_t set_glTexParameteri(glTexParameteri_client_proc_t f) { glTexParameteri_client_proc_t retval = glTexParameteri; glTexParameteri = f; return retval;}
|
||||
virtual glTexParameteriv_client_proc_t set_glTexParameteriv(glTexParameteriv_client_proc_t f) { glTexParameteriv_client_proc_t retval = glTexParameteriv; glTexParameteriv = f; return retval;}
|
||||
virtual glTexSubImage2D_client_proc_t set_glTexSubImage2D(glTexSubImage2D_client_proc_t f) { glTexSubImage2D_client_proc_t retval = glTexSubImage2D; glTexSubImage2D = f; return retval;}
|
||||
virtual glUniform1f_client_proc_t set_glUniform1f(glUniform1f_client_proc_t f) { glUniform1f_client_proc_t retval = glUniform1f; glUniform1f = f; return retval;}
|
||||
virtual glUniform1fv_client_proc_t set_glUniform1fv(glUniform1fv_client_proc_t f) { glUniform1fv_client_proc_t retval = glUniform1fv; glUniform1fv = f; return retval;}
|
||||
virtual glUniform1i_client_proc_t set_glUniform1i(glUniform1i_client_proc_t f) { glUniform1i_client_proc_t retval = glUniform1i; glUniform1i = f; return retval;}
|
||||
virtual glUniform1iv_client_proc_t set_glUniform1iv(glUniform1iv_client_proc_t f) { glUniform1iv_client_proc_t retval = glUniform1iv; glUniform1iv = f; return retval;}
|
||||
virtual glUniform2f_client_proc_t set_glUniform2f(glUniform2f_client_proc_t f) { glUniform2f_client_proc_t retval = glUniform2f; glUniform2f = f; return retval;}
|
||||
virtual glUniform2fv_client_proc_t set_glUniform2fv(glUniform2fv_client_proc_t f) { glUniform2fv_client_proc_t retval = glUniform2fv; glUniform2fv = f; return retval;}
|
||||
virtual glUniform2i_client_proc_t set_glUniform2i(glUniform2i_client_proc_t f) { glUniform2i_client_proc_t retval = glUniform2i; glUniform2i = f; return retval;}
|
||||
virtual glUniform2iv_client_proc_t set_glUniform2iv(glUniform2iv_client_proc_t f) { glUniform2iv_client_proc_t retval = glUniform2iv; glUniform2iv = f; return retval;}
|
||||
virtual glUniform3f_client_proc_t set_glUniform3f(glUniform3f_client_proc_t f) { glUniform3f_client_proc_t retval = glUniform3f; glUniform3f = f; return retval;}
|
||||
virtual glUniform3fv_client_proc_t set_glUniform3fv(glUniform3fv_client_proc_t f) { glUniform3fv_client_proc_t retval = glUniform3fv; glUniform3fv = f; return retval;}
|
||||
virtual glUniform3i_client_proc_t set_glUniform3i(glUniform3i_client_proc_t f) { glUniform3i_client_proc_t retval = glUniform3i; glUniform3i = f; return retval;}
|
||||
virtual glUniform3iv_client_proc_t set_glUniform3iv(glUniform3iv_client_proc_t f) { glUniform3iv_client_proc_t retval = glUniform3iv; glUniform3iv = f; return retval;}
|
||||
virtual glUniform4f_client_proc_t set_glUniform4f(glUniform4f_client_proc_t f) { glUniform4f_client_proc_t retval = glUniform4f; glUniform4f = f; return retval;}
|
||||
virtual glUniform4fv_client_proc_t set_glUniform4fv(glUniform4fv_client_proc_t f) { glUniform4fv_client_proc_t retval = glUniform4fv; glUniform4fv = f; return retval;}
|
||||
virtual glUniform4i_client_proc_t set_glUniform4i(glUniform4i_client_proc_t f) { glUniform4i_client_proc_t retval = glUniform4i; glUniform4i = f; return retval;}
|
||||
virtual glUniform4iv_client_proc_t set_glUniform4iv(glUniform4iv_client_proc_t f) { glUniform4iv_client_proc_t retval = glUniform4iv; glUniform4iv = f; return retval;}
|
||||
virtual glUniformMatrix2fv_client_proc_t set_glUniformMatrix2fv(glUniformMatrix2fv_client_proc_t f) { glUniformMatrix2fv_client_proc_t retval = glUniformMatrix2fv; glUniformMatrix2fv = f; return retval;}
|
||||
virtual glUniformMatrix3fv_client_proc_t set_glUniformMatrix3fv(glUniformMatrix3fv_client_proc_t f) { glUniformMatrix3fv_client_proc_t retval = glUniformMatrix3fv; glUniformMatrix3fv = f; return retval;}
|
||||
virtual glUniformMatrix4fv_client_proc_t set_glUniformMatrix4fv(glUniformMatrix4fv_client_proc_t f) { glUniformMatrix4fv_client_proc_t retval = glUniformMatrix4fv; glUniformMatrix4fv = f; return retval;}
|
||||
virtual glUseProgram_client_proc_t set_glUseProgram(glUseProgram_client_proc_t f) { glUseProgram_client_proc_t retval = glUseProgram; glUseProgram = f; return retval;}
|
||||
virtual glValidateProgram_client_proc_t set_glValidateProgram(glValidateProgram_client_proc_t f) { glValidateProgram_client_proc_t retval = glValidateProgram; glValidateProgram = f; return retval;}
|
||||
virtual glVertexAttrib1f_client_proc_t set_glVertexAttrib1f(glVertexAttrib1f_client_proc_t f) { glVertexAttrib1f_client_proc_t retval = glVertexAttrib1f; glVertexAttrib1f = f; return retval;}
|
||||
virtual glVertexAttrib1fv_client_proc_t set_glVertexAttrib1fv(glVertexAttrib1fv_client_proc_t f) { glVertexAttrib1fv_client_proc_t retval = glVertexAttrib1fv; glVertexAttrib1fv = f; return retval;}
|
||||
virtual glVertexAttrib2f_client_proc_t set_glVertexAttrib2f(glVertexAttrib2f_client_proc_t f) { glVertexAttrib2f_client_proc_t retval = glVertexAttrib2f; glVertexAttrib2f = f; return retval;}
|
||||
virtual glVertexAttrib2fv_client_proc_t set_glVertexAttrib2fv(glVertexAttrib2fv_client_proc_t f) { glVertexAttrib2fv_client_proc_t retval = glVertexAttrib2fv; glVertexAttrib2fv = f; return retval;}
|
||||
virtual glVertexAttrib3f_client_proc_t set_glVertexAttrib3f(glVertexAttrib3f_client_proc_t f) { glVertexAttrib3f_client_proc_t retval = glVertexAttrib3f; glVertexAttrib3f = f; return retval;}
|
||||
virtual glVertexAttrib3fv_client_proc_t set_glVertexAttrib3fv(glVertexAttrib3fv_client_proc_t f) { glVertexAttrib3fv_client_proc_t retval = glVertexAttrib3fv; glVertexAttrib3fv = f; return retval;}
|
||||
virtual glVertexAttrib4f_client_proc_t set_glVertexAttrib4f(glVertexAttrib4f_client_proc_t f) { glVertexAttrib4f_client_proc_t retval = glVertexAttrib4f; glVertexAttrib4f = f; return retval;}
|
||||
virtual glVertexAttrib4fv_client_proc_t set_glVertexAttrib4fv(glVertexAttrib4fv_client_proc_t f) { glVertexAttrib4fv_client_proc_t retval = glVertexAttrib4fv; glVertexAttrib4fv = f; return retval;}
|
||||
virtual glVertexAttribPointer_client_proc_t set_glVertexAttribPointer(glVertexAttribPointer_client_proc_t f) { glVertexAttribPointer_client_proc_t retval = glVertexAttribPointer; glVertexAttribPointer = f; return retval;}
|
||||
virtual glViewport_client_proc_t set_glViewport(glViewport_client_proc_t f) { glViewport_client_proc_t retval = glViewport; glViewport = f; return retval;}
|
||||
virtual glEGLImageTargetTexture2DOES_client_proc_t set_glEGLImageTargetTexture2DOES(glEGLImageTargetTexture2DOES_client_proc_t f) { glEGLImageTargetTexture2DOES_client_proc_t retval = glEGLImageTargetTexture2DOES; glEGLImageTargetTexture2DOES = f; return retval;}
|
||||
virtual glEGLImageTargetRenderbufferStorageOES_client_proc_t set_glEGLImageTargetRenderbufferStorageOES(glEGLImageTargetRenderbufferStorageOES_client_proc_t f) { glEGLImageTargetRenderbufferStorageOES_client_proc_t retval = glEGLImageTargetRenderbufferStorageOES; glEGLImageTargetRenderbufferStorageOES = f; return retval;}
|
||||
virtual glGetProgramBinaryOES_client_proc_t set_glGetProgramBinaryOES(glGetProgramBinaryOES_client_proc_t f) { glGetProgramBinaryOES_client_proc_t retval = glGetProgramBinaryOES; glGetProgramBinaryOES = f; return retval;}
|
||||
virtual glProgramBinaryOES_client_proc_t set_glProgramBinaryOES(glProgramBinaryOES_client_proc_t f) { glProgramBinaryOES_client_proc_t retval = glProgramBinaryOES; glProgramBinaryOES = f; return retval;}
|
||||
virtual glMapBufferOES_client_proc_t set_glMapBufferOES(glMapBufferOES_client_proc_t f) { glMapBufferOES_client_proc_t retval = glMapBufferOES; glMapBufferOES = f; return retval;}
|
||||
virtual glUnmapBufferOES_client_proc_t set_glUnmapBufferOES(glUnmapBufferOES_client_proc_t f) { glUnmapBufferOES_client_proc_t retval = glUnmapBufferOES; glUnmapBufferOES = f; return retval;}
|
||||
virtual glTexImage3DOES_client_proc_t set_glTexImage3DOES(glTexImage3DOES_client_proc_t f) { glTexImage3DOES_client_proc_t retval = glTexImage3DOES; glTexImage3DOES = f; return retval;}
|
||||
virtual glTexSubImage3DOES_client_proc_t set_glTexSubImage3DOES(glTexSubImage3DOES_client_proc_t f) { glTexSubImage3DOES_client_proc_t retval = glTexSubImage3DOES; glTexSubImage3DOES = f; return retval;}
|
||||
virtual glCopyTexSubImage3DOES_client_proc_t set_glCopyTexSubImage3DOES(glCopyTexSubImage3DOES_client_proc_t f) { glCopyTexSubImage3DOES_client_proc_t retval = glCopyTexSubImage3DOES; glCopyTexSubImage3DOES = f; return retval;}
|
||||
virtual glCompressedTexImage3DOES_client_proc_t set_glCompressedTexImage3DOES(glCompressedTexImage3DOES_client_proc_t f) { glCompressedTexImage3DOES_client_proc_t retval = glCompressedTexImage3DOES; glCompressedTexImage3DOES = f; return retval;}
|
||||
virtual glCompressedTexSubImage3DOES_client_proc_t set_glCompressedTexSubImage3DOES(glCompressedTexSubImage3DOES_client_proc_t f) { glCompressedTexSubImage3DOES_client_proc_t retval = glCompressedTexSubImage3DOES; glCompressedTexSubImage3DOES = f; return retval;}
|
||||
virtual glFramebufferTexture3DOES_client_proc_t set_glFramebufferTexture3DOES(glFramebufferTexture3DOES_client_proc_t f) { glFramebufferTexture3DOES_client_proc_t retval = glFramebufferTexture3DOES; glFramebufferTexture3DOES = f; return retval;}
|
||||
virtual glBindVertexArrayOES_client_proc_t set_glBindVertexArrayOES(glBindVertexArrayOES_client_proc_t f) { glBindVertexArrayOES_client_proc_t retval = glBindVertexArrayOES; glBindVertexArrayOES = f; return retval;}
|
||||
virtual glDeleteVertexArraysOES_client_proc_t set_glDeleteVertexArraysOES(glDeleteVertexArraysOES_client_proc_t f) { glDeleteVertexArraysOES_client_proc_t retval = glDeleteVertexArraysOES; glDeleteVertexArraysOES = f; return retval;}
|
||||
virtual glGenVertexArraysOES_client_proc_t set_glGenVertexArraysOES(glGenVertexArraysOES_client_proc_t f) { glGenVertexArraysOES_client_proc_t retval = glGenVertexArraysOES; glGenVertexArraysOES = f; return retval;}
|
||||
virtual glIsVertexArrayOES_client_proc_t set_glIsVertexArrayOES(glIsVertexArrayOES_client_proc_t f) { glIsVertexArrayOES_client_proc_t retval = glIsVertexArrayOES; glIsVertexArrayOES = f; return retval;}
|
||||
virtual glDiscardFramebufferEXT_client_proc_t set_glDiscardFramebufferEXT(glDiscardFramebufferEXT_client_proc_t f) { glDiscardFramebufferEXT_client_proc_t retval = glDiscardFramebufferEXT; glDiscardFramebufferEXT = f; return retval;}
|
||||
virtual glMultiDrawArraysEXT_client_proc_t set_glMultiDrawArraysEXT(glMultiDrawArraysEXT_client_proc_t f) { glMultiDrawArraysEXT_client_proc_t retval = glMultiDrawArraysEXT; glMultiDrawArraysEXT = f; return retval;}
|
||||
virtual glMultiDrawElementsEXT_client_proc_t set_glMultiDrawElementsEXT(glMultiDrawElementsEXT_client_proc_t f) { glMultiDrawElementsEXT_client_proc_t retval = glMultiDrawElementsEXT; glMultiDrawElementsEXT = f; return retval;}
|
||||
virtual glGetPerfMonitorGroupsAMD_client_proc_t set_glGetPerfMonitorGroupsAMD(glGetPerfMonitorGroupsAMD_client_proc_t f) { glGetPerfMonitorGroupsAMD_client_proc_t retval = glGetPerfMonitorGroupsAMD; glGetPerfMonitorGroupsAMD = f; return retval;}
|
||||
virtual glGetPerfMonitorCountersAMD_client_proc_t set_glGetPerfMonitorCountersAMD(glGetPerfMonitorCountersAMD_client_proc_t f) { glGetPerfMonitorCountersAMD_client_proc_t retval = glGetPerfMonitorCountersAMD; glGetPerfMonitorCountersAMD = f; return retval;}
|
||||
virtual glGetPerfMonitorGroupStringAMD_client_proc_t set_glGetPerfMonitorGroupStringAMD(glGetPerfMonitorGroupStringAMD_client_proc_t f) { glGetPerfMonitorGroupStringAMD_client_proc_t retval = glGetPerfMonitorGroupStringAMD; glGetPerfMonitorGroupStringAMD = f; return retval;}
|
||||
virtual glGetPerfMonitorCounterStringAMD_client_proc_t set_glGetPerfMonitorCounterStringAMD(glGetPerfMonitorCounterStringAMD_client_proc_t f) { glGetPerfMonitorCounterStringAMD_client_proc_t retval = glGetPerfMonitorCounterStringAMD; glGetPerfMonitorCounterStringAMD = f; return retval;}
|
||||
virtual glGetPerfMonitorCounterInfoAMD_client_proc_t set_glGetPerfMonitorCounterInfoAMD(glGetPerfMonitorCounterInfoAMD_client_proc_t f) { glGetPerfMonitorCounterInfoAMD_client_proc_t retval = glGetPerfMonitorCounterInfoAMD; glGetPerfMonitorCounterInfoAMD = f; return retval;}
|
||||
virtual glGenPerfMonitorsAMD_client_proc_t set_glGenPerfMonitorsAMD(glGenPerfMonitorsAMD_client_proc_t f) { glGenPerfMonitorsAMD_client_proc_t retval = glGenPerfMonitorsAMD; glGenPerfMonitorsAMD = f; return retval;}
|
||||
virtual glDeletePerfMonitorsAMD_client_proc_t set_glDeletePerfMonitorsAMD(glDeletePerfMonitorsAMD_client_proc_t f) { glDeletePerfMonitorsAMD_client_proc_t retval = glDeletePerfMonitorsAMD; glDeletePerfMonitorsAMD = f; return retval;}
|
||||
virtual glSelectPerfMonitorCountersAMD_client_proc_t set_glSelectPerfMonitorCountersAMD(glSelectPerfMonitorCountersAMD_client_proc_t f) { glSelectPerfMonitorCountersAMD_client_proc_t retval = glSelectPerfMonitorCountersAMD; glSelectPerfMonitorCountersAMD = f; return retval;}
|
||||
virtual glBeginPerfMonitorAMD_client_proc_t set_glBeginPerfMonitorAMD(glBeginPerfMonitorAMD_client_proc_t f) { glBeginPerfMonitorAMD_client_proc_t retval = glBeginPerfMonitorAMD; glBeginPerfMonitorAMD = f; return retval;}
|
||||
virtual glEndPerfMonitorAMD_client_proc_t set_glEndPerfMonitorAMD(glEndPerfMonitorAMD_client_proc_t f) { glEndPerfMonitorAMD_client_proc_t retval = glEndPerfMonitorAMD; glEndPerfMonitorAMD = f; return retval;}
|
||||
virtual glGetPerfMonitorCounterDataAMD_client_proc_t set_glGetPerfMonitorCounterDataAMD(glGetPerfMonitorCounterDataAMD_client_proc_t f) { glGetPerfMonitorCounterDataAMD_client_proc_t retval = glGetPerfMonitorCounterDataAMD; glGetPerfMonitorCounterDataAMD = f; return retval;}
|
||||
virtual glRenderbufferStorageMultisampleIMG_client_proc_t set_glRenderbufferStorageMultisampleIMG(glRenderbufferStorageMultisampleIMG_client_proc_t f) { glRenderbufferStorageMultisampleIMG_client_proc_t retval = glRenderbufferStorageMultisampleIMG; glRenderbufferStorageMultisampleIMG = f; return retval;}
|
||||
virtual glFramebufferTexture2DMultisampleIMG_client_proc_t set_glFramebufferTexture2DMultisampleIMG(glFramebufferTexture2DMultisampleIMG_client_proc_t f) { glFramebufferTexture2DMultisampleIMG_client_proc_t retval = glFramebufferTexture2DMultisampleIMG; glFramebufferTexture2DMultisampleIMG = f; return retval;}
|
||||
virtual glDeleteFencesNV_client_proc_t set_glDeleteFencesNV(glDeleteFencesNV_client_proc_t f) { glDeleteFencesNV_client_proc_t retval = glDeleteFencesNV; glDeleteFencesNV = f; return retval;}
|
||||
virtual glGenFencesNV_client_proc_t set_glGenFencesNV(glGenFencesNV_client_proc_t f) { glGenFencesNV_client_proc_t retval = glGenFencesNV; glGenFencesNV = f; return retval;}
|
||||
virtual glIsFenceNV_client_proc_t set_glIsFenceNV(glIsFenceNV_client_proc_t f) { glIsFenceNV_client_proc_t retval = glIsFenceNV; glIsFenceNV = f; return retval;}
|
||||
virtual glTestFenceNV_client_proc_t set_glTestFenceNV(glTestFenceNV_client_proc_t f) { glTestFenceNV_client_proc_t retval = glTestFenceNV; glTestFenceNV = f; return retval;}
|
||||
virtual glGetFenceivNV_client_proc_t set_glGetFenceivNV(glGetFenceivNV_client_proc_t f) { glGetFenceivNV_client_proc_t retval = glGetFenceivNV; glGetFenceivNV = f; return retval;}
|
||||
virtual glFinishFenceNV_client_proc_t set_glFinishFenceNV(glFinishFenceNV_client_proc_t f) { glFinishFenceNV_client_proc_t retval = glFinishFenceNV; glFinishFenceNV = f; return retval;}
|
||||
virtual glSetFenceNV_client_proc_t set_glSetFenceNV(glSetFenceNV_client_proc_t f) { glSetFenceNV_client_proc_t retval = glSetFenceNV; glSetFenceNV = f; return retval;}
|
||||
virtual glCoverageMaskNV_client_proc_t set_glCoverageMaskNV(glCoverageMaskNV_client_proc_t f) { glCoverageMaskNV_client_proc_t retval = glCoverageMaskNV; glCoverageMaskNV = f; return retval;}
|
||||
virtual glCoverageOperationNV_client_proc_t set_glCoverageOperationNV(glCoverageOperationNV_client_proc_t f) { glCoverageOperationNV_client_proc_t retval = glCoverageOperationNV; glCoverageOperationNV = f; return retval;}
|
||||
virtual glGetDriverControlsQCOM_client_proc_t set_glGetDriverControlsQCOM(glGetDriverControlsQCOM_client_proc_t f) { glGetDriverControlsQCOM_client_proc_t retval = glGetDriverControlsQCOM; glGetDriverControlsQCOM = f; return retval;}
|
||||
virtual glGetDriverControlStringQCOM_client_proc_t set_glGetDriverControlStringQCOM(glGetDriverControlStringQCOM_client_proc_t f) { glGetDriverControlStringQCOM_client_proc_t retval = glGetDriverControlStringQCOM; glGetDriverControlStringQCOM = f; return retval;}
|
||||
virtual glEnableDriverControlQCOM_client_proc_t set_glEnableDriverControlQCOM(glEnableDriverControlQCOM_client_proc_t f) { glEnableDriverControlQCOM_client_proc_t retval = glEnableDriverControlQCOM; glEnableDriverControlQCOM = f; return retval;}
|
||||
virtual glDisableDriverControlQCOM_client_proc_t set_glDisableDriverControlQCOM(glDisableDriverControlQCOM_client_proc_t f) { glDisableDriverControlQCOM_client_proc_t retval = glDisableDriverControlQCOM; glDisableDriverControlQCOM = f; return retval;}
|
||||
virtual glExtGetTexturesQCOM_client_proc_t set_glExtGetTexturesQCOM(glExtGetTexturesQCOM_client_proc_t f) { glExtGetTexturesQCOM_client_proc_t retval = glExtGetTexturesQCOM; glExtGetTexturesQCOM = f; return retval;}
|
||||
virtual glExtGetBuffersQCOM_client_proc_t set_glExtGetBuffersQCOM(glExtGetBuffersQCOM_client_proc_t f) { glExtGetBuffersQCOM_client_proc_t retval = glExtGetBuffersQCOM; glExtGetBuffersQCOM = f; return retval;}
|
||||
virtual glExtGetRenderbuffersQCOM_client_proc_t set_glExtGetRenderbuffersQCOM(glExtGetRenderbuffersQCOM_client_proc_t f) { glExtGetRenderbuffersQCOM_client_proc_t retval = glExtGetRenderbuffersQCOM; glExtGetRenderbuffersQCOM = f; return retval;}
|
||||
virtual glExtGetFramebuffersQCOM_client_proc_t set_glExtGetFramebuffersQCOM(glExtGetFramebuffersQCOM_client_proc_t f) { glExtGetFramebuffersQCOM_client_proc_t retval = glExtGetFramebuffersQCOM; glExtGetFramebuffersQCOM = f; return retval;}
|
||||
virtual glExtGetTexLevelParameterivQCOM_client_proc_t set_glExtGetTexLevelParameterivQCOM(glExtGetTexLevelParameterivQCOM_client_proc_t f) { glExtGetTexLevelParameterivQCOM_client_proc_t retval = glExtGetTexLevelParameterivQCOM; glExtGetTexLevelParameterivQCOM = f; return retval;}
|
||||
virtual glExtTexObjectStateOverrideiQCOM_client_proc_t set_glExtTexObjectStateOverrideiQCOM(glExtTexObjectStateOverrideiQCOM_client_proc_t f) { glExtTexObjectStateOverrideiQCOM_client_proc_t retval = glExtTexObjectStateOverrideiQCOM; glExtTexObjectStateOverrideiQCOM = f; return retval;}
|
||||
virtual glExtGetTexSubImageQCOM_client_proc_t set_glExtGetTexSubImageQCOM(glExtGetTexSubImageQCOM_client_proc_t f) { glExtGetTexSubImageQCOM_client_proc_t retval = glExtGetTexSubImageQCOM; glExtGetTexSubImageQCOM = f; return retval;}
|
||||
virtual glExtGetBufferPointervQCOM_client_proc_t set_glExtGetBufferPointervQCOM(glExtGetBufferPointervQCOM_client_proc_t f) { glExtGetBufferPointervQCOM_client_proc_t retval = glExtGetBufferPointervQCOM; glExtGetBufferPointervQCOM = f; return retval;}
|
||||
virtual glExtGetShadersQCOM_client_proc_t set_glExtGetShadersQCOM(glExtGetShadersQCOM_client_proc_t f) { glExtGetShadersQCOM_client_proc_t retval = glExtGetShadersQCOM; glExtGetShadersQCOM = f; return retval;}
|
||||
virtual glExtGetProgramsQCOM_client_proc_t set_glExtGetProgramsQCOM(glExtGetProgramsQCOM_client_proc_t f) { glExtGetProgramsQCOM_client_proc_t retval = glExtGetProgramsQCOM; glExtGetProgramsQCOM = f; return retval;}
|
||||
virtual glExtIsProgramBinaryQCOM_client_proc_t set_glExtIsProgramBinaryQCOM(glExtIsProgramBinaryQCOM_client_proc_t f) { glExtIsProgramBinaryQCOM_client_proc_t retval = glExtIsProgramBinaryQCOM; glExtIsProgramBinaryQCOM = f; return retval;}
|
||||
virtual glExtGetProgramBinarySourceQCOM_client_proc_t set_glExtGetProgramBinarySourceQCOM(glExtGetProgramBinarySourceQCOM_client_proc_t f) { glExtGetProgramBinarySourceQCOM_client_proc_t retval = glExtGetProgramBinarySourceQCOM; glExtGetProgramBinarySourceQCOM = f; return retval;}
|
||||
virtual glStartTilingQCOM_client_proc_t set_glStartTilingQCOM(glStartTilingQCOM_client_proc_t f) { glStartTilingQCOM_client_proc_t retval = glStartTilingQCOM; glStartTilingQCOM = f; return retval;}
|
||||
virtual glEndTilingQCOM_client_proc_t set_glEndTilingQCOM(glEndTilingQCOM_client_proc_t f) { glEndTilingQCOM_client_proc_t retval = glEndTilingQCOM; glEndTilingQCOM = f; return retval;}
|
||||
virtual glVertexAttribPointerData_client_proc_t set_glVertexAttribPointerData(glVertexAttribPointerData_client_proc_t f) { glVertexAttribPointerData_client_proc_t retval = glVertexAttribPointerData; glVertexAttribPointerData = f; return retval;}
|
||||
virtual glVertexAttribPointerOffset_client_proc_t set_glVertexAttribPointerOffset(glVertexAttribPointerOffset_client_proc_t f) { glVertexAttribPointerOffset_client_proc_t retval = glVertexAttribPointerOffset; glVertexAttribPointerOffset = f; return retval;}
|
||||
virtual glDrawElementsOffset_client_proc_t set_glDrawElementsOffset(glDrawElementsOffset_client_proc_t f) { glDrawElementsOffset_client_proc_t retval = glDrawElementsOffset; glDrawElementsOffset = f; return retval;}
|
||||
virtual glDrawElementsData_client_proc_t set_glDrawElementsData(glDrawElementsData_client_proc_t f) { glDrawElementsData_client_proc_t retval = glDrawElementsData; glDrawElementsData = f; return retval;}
|
||||
virtual glGetCompressedTextureFormats_client_proc_t set_glGetCompressedTextureFormats(glGetCompressedTextureFormats_client_proc_t f) { glGetCompressedTextureFormats_client_proc_t retval = glGetCompressedTextureFormats; glGetCompressedTextureFormats = f; return retval;}
|
||||
virtual glShaderString_client_proc_t set_glShaderString(glShaderString_client_proc_t f) { glShaderString_client_proc_t retval = glShaderString; glShaderString = f; return retval;}
|
||||
virtual glFinishRoundTrip_client_proc_t set_glFinishRoundTrip(glFinishRoundTrip_client_proc_t f) { glFinishRoundTrip_client_proc_t retval = glFinishRoundTrip; glFinishRoundTrip = f; return retval;}
|
||||
virtual ~gl2_client_context_t() {}
|
||||
|
||||
typedef gl2_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
|
||||
static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
|
||||
int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
|
||||
virtual void setError(unsigned int error){};
|
||||
virtual unsigned int getError(){ return 0; };
|
||||
};
|
||||
|
||||
#endif
|
||||
222
tools/emulator/opengl/system/GLESv2_enc/gl2_client_proc.h
Normal file
222
tools/emulator/opengl/system/GLESv2_enc/gl2_client_proc.h
Normal file
@@ -0,0 +1,222 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __gl2_client_proc_t_h
|
||||
#define __gl2_client_proc_t_h
|
||||
|
||||
|
||||
|
||||
#include "gl2_types.h"
|
||||
#ifndef gl2_APIENTRY
|
||||
#define gl2_APIENTRY
|
||||
#endif
|
||||
typedef void (gl2_APIENTRY *glActiveTexture_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glAttachShader_client_proc_t) (void * ctx, GLuint, GLuint);
|
||||
typedef void (gl2_APIENTRY *glBindAttribLocation_client_proc_t) (void * ctx, GLuint, GLuint, const GLchar*);
|
||||
typedef void (gl2_APIENTRY *glBindBuffer_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl2_APIENTRY *glBindFramebuffer_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl2_APIENTRY *glBindRenderbuffer_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl2_APIENTRY *glBindTexture_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl2_APIENTRY *glBlendColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
|
||||
typedef void (gl2_APIENTRY *glBlendEquation_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glBlendEquationSeparate_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef void (gl2_APIENTRY *glBlendFunc_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef void (gl2_APIENTRY *glBlendFuncSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
|
||||
typedef void (gl2_APIENTRY *glBufferData_client_proc_t) (void * ctx, GLenum, GLsizeiptr, const GLvoid*, GLenum);
|
||||
typedef void (gl2_APIENTRY *glBufferSubData_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, const GLvoid*);
|
||||
typedef GLenum (gl2_APIENTRY *glCheckFramebufferStatus_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glClear_client_proc_t) (void * ctx, GLbitfield);
|
||||
typedef void (gl2_APIENTRY *glClearColor_client_proc_t) (void * ctx, GLclampf, GLclampf, GLclampf, GLclampf);
|
||||
typedef void (gl2_APIENTRY *glClearDepthf_client_proc_t) (void * ctx, GLclampf);
|
||||
typedef void (gl2_APIENTRY *glClearStencil_client_proc_t) (void * ctx, GLint);
|
||||
typedef void (gl2_APIENTRY *glColorMask_client_proc_t) (void * ctx, GLboolean, GLboolean, GLboolean, GLboolean);
|
||||
typedef void (gl2_APIENTRY *glCompileShader_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glCompressedTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glCompressedTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glCopyTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint);
|
||||
typedef void (gl2_APIENTRY *glCopyTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
typedef GLuint (gl2_APIENTRY *glCreateProgram_client_proc_t) (void * ctx);
|
||||
typedef GLuint (gl2_APIENTRY *glCreateShader_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glCullFace_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glDeleteBuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl2_APIENTRY *glDeleteFramebuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl2_APIENTRY *glDeleteProgram_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDeleteRenderbuffers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl2_APIENTRY *glDeleteShader_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDeleteTextures_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl2_APIENTRY *glDepthFunc_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glDepthMask_client_proc_t) (void * ctx, GLboolean);
|
||||
typedef void (gl2_APIENTRY *glDepthRangef_client_proc_t) (void * ctx, GLclampf, GLclampf);
|
||||
typedef void (gl2_APIENTRY *glDetachShader_client_proc_t) (void * ctx, GLuint, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDisable_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glDisableVertexAttribArray_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDrawArrays_client_proc_t) (void * ctx, GLenum, GLint, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glDrawElements_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glEnable_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glEnableVertexAttribArray_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glFinish_client_proc_t) (void * ctx);
|
||||
typedef void (gl2_APIENTRY *glFlush_client_proc_t) (void * ctx);
|
||||
typedef void (gl2_APIENTRY *glFramebufferRenderbuffer_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint);
|
||||
typedef void (gl2_APIENTRY *glFramebufferTexture2D_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
typedef void (gl2_APIENTRY *glFrontFace_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glGenBuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGenerateMipmap_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glGenFramebuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGenRenderbuffers_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGenTextures_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGetActiveAttrib_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetActiveUniform_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetAttachedShaders_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLuint*);
|
||||
typedef int (gl2_APIENTRY *glGetAttribLocation_client_proc_t) (void * ctx, GLuint, const GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetBooleanv_client_proc_t) (void * ctx, GLenum, GLboolean*);
|
||||
typedef void (gl2_APIENTRY *glGetBufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef GLenum (gl2_APIENTRY *glGetError_client_proc_t) (void * ctx);
|
||||
typedef void (gl2_APIENTRY *glGetFloatv_client_proc_t) (void * ctx, GLenum, GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glGetFramebufferAttachmentParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetIntegerv_client_proc_t) (void * ctx, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetProgramiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetProgramInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetRenderbufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetShaderiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetShaderInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetShaderPrecisionFormat_client_proc_t) (void * ctx, GLenum, GLenum, GLint*, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
|
||||
typedef const GLubyte* (gl2_APIENTRY *glGetString_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glGetTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glGetTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetUniformfv_client_proc_t) (void * ctx, GLuint, GLint, GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glGetUniformiv_client_proc_t) (void * ctx, GLuint, GLint, GLint*);
|
||||
typedef int (gl2_APIENTRY *glGetUniformLocation_client_proc_t) (void * ctx, GLuint, const GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetVertexAttribfv_client_proc_t) (void * ctx, GLuint, GLenum, GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glGetVertexAttribiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glGetVertexAttribPointerv_client_proc_t) (void * ctx, GLuint, GLenum, GLvoid**);
|
||||
typedef void (gl2_APIENTRY *glHint_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsBuffer_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsEnabled_client_proc_t) (void * ctx, GLenum);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsFramebuffer_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsProgram_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsRenderbuffer_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsShader_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsTexture_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glLineWidth_client_proc_t) (void * ctx, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glLinkProgram_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glPixelStorei_client_proc_t) (void * ctx, GLenum, GLint);
|
||||
typedef void (gl2_APIENTRY *glPolygonOffset_client_proc_t) (void * ctx, GLfloat, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glReadPixels_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glReleaseShaderCompiler_client_proc_t) (void * ctx);
|
||||
typedef void (gl2_APIENTRY *glRenderbufferStorage_client_proc_t) (void * ctx, GLenum, GLenum, GLsizei, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glSampleCoverage_client_proc_t) (void * ctx, GLclampf, GLboolean);
|
||||
typedef void (gl2_APIENTRY *glScissor_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glShaderBinary_client_proc_t) (void * ctx, GLsizei, const GLuint*, GLenum, const GLvoid*, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glShaderSource_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar**, const GLint*);
|
||||
typedef void (gl2_APIENTRY *glStencilFunc_client_proc_t) (void * ctx, GLenum, GLint, GLuint);
|
||||
typedef void (gl2_APIENTRY *glStencilFuncSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLint, GLuint);
|
||||
typedef void (gl2_APIENTRY *glStencilMask_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glStencilMaskSeparate_client_proc_t) (void * ctx, GLenum, GLuint);
|
||||
typedef void (gl2_APIENTRY *glStencilOp_client_proc_t) (void * ctx, GLenum, GLenum, GLenum);
|
||||
typedef void (gl2_APIENTRY *glStencilOpSeparate_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLenum);
|
||||
typedef void (gl2_APIENTRY *glTexImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glTexParameterf_client_proc_t) (void * ctx, GLenum, GLenum, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glTexParameterfv_client_proc_t) (void * ctx, GLenum, GLenum, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glTexParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
|
||||
typedef void (gl2_APIENTRY *glTexParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, const GLint*);
|
||||
typedef void (gl2_APIENTRY *glTexSubImage2D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glUniform1f_client_proc_t) (void * ctx, GLint, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glUniform1fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glUniform1i_client_proc_t) (void * ctx, GLint, GLint);
|
||||
typedef void (gl2_APIENTRY *glUniform1iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
|
||||
typedef void (gl2_APIENTRY *glUniform2f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glUniform2fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glUniform2i_client_proc_t) (void * ctx, GLint, GLint, GLint);
|
||||
typedef void (gl2_APIENTRY *glUniform2iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
|
||||
typedef void (gl2_APIENTRY *glUniform3f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glUniform3fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glUniform3i_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint);
|
||||
typedef void (gl2_APIENTRY *glUniform3iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
|
||||
typedef void (gl2_APIENTRY *glUniform4f_client_proc_t) (void * ctx, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glUniform4fv_client_proc_t) (void * ctx, GLint, GLsizei, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glUniform4i_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint);
|
||||
typedef void (gl2_APIENTRY *glUniform4iv_client_proc_t) (void * ctx, GLint, GLsizei, const GLint*);
|
||||
typedef void (gl2_APIENTRY *glUniformMatrix2fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glUniformMatrix3fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glUniformMatrix4fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glUseProgram_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glValidateProgram_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib1f_client_proc_t) (void * ctx, GLuint, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib1fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib2f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib2fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib3f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib3fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib4f_client_proc_t) (void * ctx, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
typedef void (gl2_APIENTRY *glVertexAttrib4fv_client_proc_t) (void * ctx, GLuint, const GLfloat*);
|
||||
typedef void (gl2_APIENTRY *glVertexAttribPointer_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glViewport_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glEGLImageTargetTexture2DOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
|
||||
typedef void (gl2_APIENTRY *glEGLImageTargetRenderbufferStorageOES_client_proc_t) (void * ctx, GLenum, GLeglImageOES);
|
||||
typedef void (gl2_APIENTRY *glGetProgramBinaryOES_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLenum*, GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glProgramBinaryOES_client_proc_t) (void * ctx, GLuint, GLenum, const GLvoid*, GLint);
|
||||
typedef void* (gl2_APIENTRY *glMapBufferOES_client_proc_t) (void * ctx, GLenum, GLenum);
|
||||
typedef GLboolean (gl2_APIENTRY *glUnmapBufferOES_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glTexImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glCopyTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glCompressedTexImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glCompressedTexSubImage3DOES_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glFramebufferTexture3DOES_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
typedef void (gl2_APIENTRY *glBindVertexArrayOES_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDeleteVertexArraysOES_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGenVertexArraysOES_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsVertexArrayOES_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDiscardFramebufferEXT_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
|
||||
typedef void (gl2_APIENTRY *glMultiDrawArraysEXT_client_proc_t) (void * ctx, GLenum, GLint*, GLsizei*, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glMultiDrawElementsEXT_client_proc_t) (void * ctx, GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glGetPerfMonitorGroupsAMD_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGetPerfMonitorCountersAMD_client_proc_t) (void * ctx, GLuint, GLint*, GLint*, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGetPerfMonitorGroupStringAMD_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetPerfMonitorCounterStringAMD_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLchar*);
|
||||
typedef void (gl2_APIENTRY *glGetPerfMonitorCounterInfoAMD_client_proc_t) (void * ctx, GLuint, GLuint, GLenum, GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glGenPerfMonitorsAMD_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glDeletePerfMonitorsAMD_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glSelectPerfMonitorCountersAMD_client_proc_t) (void * ctx, GLuint, GLboolean, GLuint, GLint, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glBeginPerfMonitorAMD_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glEndPerfMonitorAMD_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glGetPerfMonitorCounterDataAMD_client_proc_t) (void * ctx, GLuint, GLenum, GLsizei, GLuint*, GLint*);
|
||||
typedef void (gl2_APIENTRY *glRenderbufferStorageMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glFramebufferTexture2DMultisampleIMG_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
|
||||
typedef void (gl2_APIENTRY *glDeleteFencesNV_client_proc_t) (void * ctx, GLsizei, const GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGenFencesNV_client_proc_t) (void * ctx, GLsizei, GLuint*);
|
||||
typedef GLboolean (gl2_APIENTRY *glIsFenceNV_client_proc_t) (void * ctx, GLuint);
|
||||
typedef GLboolean (gl2_APIENTRY *glTestFenceNV_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glGetFenceivNV_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glFinishFenceNV_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glSetFenceNV_client_proc_t) (void * ctx, GLuint, GLenum);
|
||||
typedef void (gl2_APIENTRY *glCoverageMaskNV_client_proc_t) (void * ctx, GLboolean);
|
||||
typedef void (gl2_APIENTRY *glCoverageOperationNV_client_proc_t) (void * ctx, GLenum);
|
||||
typedef void (gl2_APIENTRY *glGetDriverControlsQCOM_client_proc_t) (void * ctx, GLint*, GLsizei, GLuint*);
|
||||
typedef void (gl2_APIENTRY *glGetDriverControlStringQCOM_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
|
||||
typedef void (gl2_APIENTRY *glEnableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDisableDriverControlQCOM_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glExtGetTexturesQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl2_APIENTRY *glExtGetBuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl2_APIENTRY *glExtGetRenderbuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl2_APIENTRY *glExtGetFramebuffersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl2_APIENTRY *glExtGetTexLevelParameterivQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLint, GLenum, GLint*);
|
||||
typedef void (gl2_APIENTRY *glExtTexObjectStateOverrideiQCOM_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
|
||||
typedef void (gl2_APIENTRY *glExtGetTexSubImageQCOM_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLvoid*);
|
||||
typedef void (gl2_APIENTRY *glExtGetBufferPointervQCOM_client_proc_t) (void * ctx, GLenum, GLvoidptr*);
|
||||
typedef void (gl2_APIENTRY *glExtGetShadersQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef void (gl2_APIENTRY *glExtGetProgramsQCOM_client_proc_t) (void * ctx, GLuint*, GLint, GLint*);
|
||||
typedef GLboolean (gl2_APIENTRY *glExtIsProgramBinaryQCOM_client_proc_t) (void * ctx, GLuint);
|
||||
typedef void (gl2_APIENTRY *glExtGetProgramBinarySourceQCOM_client_proc_t) (void * ctx, GLuint, GLenum, GLchar*, GLint*);
|
||||
typedef void (gl2_APIENTRY *glStartTilingQCOM_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLbitfield);
|
||||
typedef void (gl2_APIENTRY *glEndTilingQCOM_client_proc_t) (void * ctx, GLbitfield);
|
||||
typedef void (gl2_APIENTRY *glVertexAttribPointerData_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, void*, GLuint);
|
||||
typedef void (gl2_APIENTRY *glVertexAttribPointerOffset_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDrawElementsOffset_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint);
|
||||
typedef void (gl2_APIENTRY *glDrawElementsData_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, void*, GLuint);
|
||||
typedef void (gl2_APIENTRY *glGetCompressedTextureFormats_client_proc_t) (void * ctx, int, GLint*);
|
||||
typedef void (gl2_APIENTRY *glShaderString_client_proc_t) (void * ctx, GLuint, const GLchar*, GLsizei);
|
||||
typedef int (gl2_APIENTRY *glFinishRoundTrip_client_proc_t) (void * ctx);
|
||||
|
||||
|
||||
#endif
|
||||
3130
tools/emulator/opengl/system/GLESv2_enc/gl2_enc.cpp
Normal file
3130
tools/emulator/opengl/system/GLESv2_enc/gl2_enc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
234
tools/emulator/opengl/system/GLESv2_enc/gl2_enc.h
Normal file
234
tools/emulator/opengl/system/GLESv2_enc/gl2_enc.h
Normal file
@@ -0,0 +1,234 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
#ifndef GUARD_gl2_encoder_context_t
|
||||
#define GUARD_gl2_encoder_context_t
|
||||
|
||||
#include "IOStream.h"
|
||||
#include "gl2_client_context.h"
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "glUtils.h"
|
||||
#include "GL2EncoderUtils.h"
|
||||
|
||||
struct gl2_encoder_context_t : public gl2_client_context_t {
|
||||
|
||||
IOStream *m_stream;
|
||||
|
||||
gl2_encoder_context_t(IOStream *stream);
|
||||
|
||||
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
void glActiveTexture_enc(void *self , GLenum texture);
|
||||
void glAttachShader_enc(void *self , GLuint program, GLuint shader);
|
||||
void glBindAttribLocation_enc(void *self , GLuint program, GLuint index, const GLchar* name);
|
||||
void glBindBuffer_enc(void *self , GLenum target, GLuint buffer);
|
||||
void glBindFramebuffer_enc(void *self , GLenum target, GLuint framebuffer);
|
||||
void glBindRenderbuffer_enc(void *self , GLenum target, GLuint renderbuffer);
|
||||
void glBindTexture_enc(void *self , GLenum target, GLuint texture);
|
||||
void glBlendColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void glBlendEquation_enc(void *self , GLenum mode);
|
||||
void glBlendEquationSeparate_enc(void *self , GLenum modeRGB, GLenum modeAlpha);
|
||||
void glBlendFunc_enc(void *self , GLenum sfactor, GLenum dfactor);
|
||||
void glBlendFuncSeparate_enc(void *self , GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glBufferData_enc(void *self , GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
|
||||
void glBufferSubData_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
|
||||
GLenum glCheckFramebufferStatus_enc(void *self , GLenum target);
|
||||
void glClear_enc(void *self , GLbitfield mask);
|
||||
void glClearColor_enc(void *self , GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void glClearDepthf_enc(void *self , GLclampf depth);
|
||||
void glClearStencil_enc(void *self , GLint s);
|
||||
void glColorMask_enc(void *self , GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
void glCompileShader_enc(void *self , GLuint shader);
|
||||
void glCompressedTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
|
||||
void glCompressedTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
|
||||
void glCopyTexImage2D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glCopyTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GLuint glCreateProgram_enc(void *self );
|
||||
GLuint glCreateShader_enc(void *self , GLenum type);
|
||||
void glCullFace_enc(void *self , GLenum mode);
|
||||
void glDeleteBuffers_enc(void *self , GLsizei n, const GLuint* buffers);
|
||||
void glDeleteFramebuffers_enc(void *self , GLsizei n, const GLuint* framebuffers);
|
||||
void glDeleteProgram_enc(void *self , GLuint program);
|
||||
void glDeleteRenderbuffers_enc(void *self , GLsizei n, const GLuint* renderbuffers);
|
||||
void glDeleteShader_enc(void *self , GLuint shader);
|
||||
void glDeleteTextures_enc(void *self , GLsizei n, const GLuint* textures);
|
||||
void glDepthFunc_enc(void *self , GLenum func);
|
||||
void glDepthMask_enc(void *self , GLboolean flag);
|
||||
void glDepthRangef_enc(void *self , GLclampf zNear, GLclampf zFar);
|
||||
void glDetachShader_enc(void *self , GLuint program, GLuint shader);
|
||||
void glDisable_enc(void *self , GLenum cap);
|
||||
void glDisableVertexAttribArray_enc(void *self , GLuint index);
|
||||
void glDrawArrays_enc(void *self , GLenum mode, GLint first, GLsizei count);
|
||||
void glDrawElements_enc(void *self , GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
|
||||
void glEnable_enc(void *self , GLenum cap);
|
||||
void glEnableVertexAttribArray_enc(void *self , GLuint index);
|
||||
void glFinish_enc(void *self );
|
||||
void glFlush_enc(void *self );
|
||||
void glFramebufferRenderbuffer_enc(void *self , GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
void glFramebufferTexture2D_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
void glFrontFace_enc(void *self , GLenum mode);
|
||||
void glGenBuffers_enc(void *self , GLsizei n, GLuint* buffers);
|
||||
void glGenerateMipmap_enc(void *self , GLenum target);
|
||||
void glGenFramebuffers_enc(void *self , GLsizei n, GLuint* framebuffers);
|
||||
void glGenRenderbuffers_enc(void *self , GLsizei n, GLuint* renderbuffers);
|
||||
void glGenTextures_enc(void *self , GLsizei n, GLuint* textures);
|
||||
void glGetActiveAttrib_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
||||
void glGetActiveUniform_enc(void *self , GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
||||
void glGetAttachedShaders_enc(void *self , GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
|
||||
int glGetAttribLocation_enc(void *self , GLuint program, const GLchar* name);
|
||||
void glGetBooleanv_enc(void *self , GLenum pname, GLboolean* params);
|
||||
void glGetBufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params);
|
||||
GLenum glGetError_enc(void *self );
|
||||
void glGetFloatv_enc(void *self , GLenum pname, GLfloat* params);
|
||||
void glGetFramebufferAttachmentParameteriv_enc(void *self , GLenum target, GLenum attachment, GLenum pname, GLint* params);
|
||||
void glGetIntegerv_enc(void *self , GLenum pname, GLint* params);
|
||||
void glGetProgramiv_enc(void *self , GLuint program, GLenum pname, GLint* params);
|
||||
void glGetProgramInfoLog_enc(void *self , GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
||||
void glGetRenderbufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params);
|
||||
void glGetShaderiv_enc(void *self , GLuint shader, GLenum pname, GLint* params);
|
||||
void glGetShaderInfoLog_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
||||
void glGetShaderPrecisionFormat_enc(void *self , GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
|
||||
void glGetShaderSource_enc(void *self , GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
|
||||
const GLubyte* glGetString_enc(void *self , GLenum name);
|
||||
void glGetTexParameterfv_enc(void *self , GLenum target, GLenum pname, GLfloat* params);
|
||||
void glGetTexParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params);
|
||||
void glGetUniformfv_enc(void *self , GLuint program, GLint location, GLfloat* params);
|
||||
void glGetUniformiv_enc(void *self , GLuint program, GLint location, GLint* params);
|
||||
int glGetUniformLocation_enc(void *self , GLuint program, const GLchar* name);
|
||||
void glGetVertexAttribfv_enc(void *self , GLuint index, GLenum pname, GLfloat* params);
|
||||
void glGetVertexAttribiv_enc(void *self , GLuint index, GLenum pname, GLint* params);
|
||||
void glGetVertexAttribPointerv_enc(void *self , GLuint index, GLenum pname, GLvoid** pointer);
|
||||
void glHint_enc(void *self , GLenum target, GLenum mode);
|
||||
GLboolean glIsBuffer_enc(void *self , GLuint buffer);
|
||||
GLboolean glIsEnabled_enc(void *self , GLenum cap);
|
||||
GLboolean glIsFramebuffer_enc(void *self , GLuint framebuffer);
|
||||
GLboolean glIsProgram_enc(void *self , GLuint program);
|
||||
GLboolean glIsRenderbuffer_enc(void *self , GLuint renderbuffer);
|
||||
GLboolean glIsShader_enc(void *self , GLuint shader);
|
||||
GLboolean glIsTexture_enc(void *self , GLuint texture);
|
||||
void glLineWidth_enc(void *self , GLfloat width);
|
||||
void glLinkProgram_enc(void *self , GLuint program);
|
||||
void glPixelStorei_enc(void *self , GLenum pname, GLint param);
|
||||
void glPolygonOffset_enc(void *self , GLfloat factor, GLfloat units);
|
||||
void glReadPixels_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
||||
void glReleaseShaderCompiler_enc(void *self );
|
||||
void glRenderbufferStorage_enc(void *self , GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glSampleCoverage_enc(void *self , GLclampf value, GLboolean invert);
|
||||
void glScissor_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glShaderBinary_enc(void *self , GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
|
||||
void glShaderSource_enc(void *self , GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
|
||||
void glStencilFunc_enc(void *self , GLenum func, GLint ref, GLuint mask);
|
||||
void glStencilFuncSeparate_enc(void *self , GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
void glStencilMask_enc(void *self , GLuint mask);
|
||||
void glStencilMaskSeparate_enc(void *self , GLenum face, GLuint mask);
|
||||
void glStencilOp_enc(void *self , GLenum fail, GLenum zfail, GLenum zpass);
|
||||
void glStencilOpSeparate_enc(void *self , GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
||||
void glTexImage2D_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void glTexParameterf_enc(void *self , GLenum target, GLenum pname, GLfloat param);
|
||||
void glTexParameterfv_enc(void *self , GLenum target, GLenum pname, const GLfloat* params);
|
||||
void glTexParameteri_enc(void *self , GLenum target, GLenum pname, GLint param);
|
||||
void glTexParameteriv_enc(void *self , GLenum target, GLenum pname, const GLint* params);
|
||||
void glTexSubImage2D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void glUniform1f_enc(void *self , GLint location, GLfloat x);
|
||||
void glUniform1fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
void glUniform1i_enc(void *self , GLint location, GLint x);
|
||||
void glUniform1iv_enc(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
void glUniform2f_enc(void *self , GLint location, GLfloat x, GLfloat y);
|
||||
void glUniform2fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
void glUniform2i_enc(void *self , GLint location, GLint x, GLint y);
|
||||
void glUniform2iv_enc(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
void glUniform3f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glUniform3fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
void glUniform3i_enc(void *self , GLint location, GLint x, GLint y, GLint z);
|
||||
void glUniform3iv_enc(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
void glUniform4f_enc(void *self , GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void glUniform4fv_enc(void *self , GLint location, GLsizei count, const GLfloat* v);
|
||||
void glUniform4i_enc(void *self , GLint location, GLint x, GLint y, GLint z, GLint w);
|
||||
void glUniform4iv_enc(void *self , GLint location, GLsizei count, const GLint* v);
|
||||
void glUniformMatrix2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
void glUniformMatrix3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
void glUniformMatrix4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
||||
void glUseProgram_enc(void *self , GLuint program);
|
||||
void glValidateProgram_enc(void *self , GLuint program);
|
||||
void glVertexAttrib1f_enc(void *self , GLuint indx, GLfloat x);
|
||||
void glVertexAttrib1fv_enc(void *self , GLuint indx, const GLfloat* values);
|
||||
void glVertexAttrib2f_enc(void *self , GLuint indx, GLfloat x, GLfloat y);
|
||||
void glVertexAttrib2fv_enc(void *self , GLuint indx, const GLfloat* values);
|
||||
void glVertexAttrib3f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glVertexAttrib3fv_enc(void *self , GLuint indx, const GLfloat* values);
|
||||
void glVertexAttrib4f_enc(void *self , GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void glVertexAttrib4fv_enc(void *self , GLuint indx, const GLfloat* values);
|
||||
void glVertexAttribPointer_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
|
||||
void glViewport_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glEGLImageTargetTexture2DOES_enc(void *self , GLenum target, GLeglImageOES image);
|
||||
void glEGLImageTargetRenderbufferStorageOES_enc(void *self , GLenum target, GLeglImageOES image);
|
||||
void glGetProgramBinaryOES_enc(void *self , GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary);
|
||||
void glProgramBinaryOES_enc(void *self , GLuint program, GLenum binaryFormat, const GLvoid* binary, GLint length);
|
||||
void* glMapBufferOES_enc(void *self , GLenum target, GLenum access);
|
||||
GLboolean glUnmapBufferOES_enc(void *self , GLenum target);
|
||||
void glTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void glTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
void glCopyTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glCompressedTexImage3DOES_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
|
||||
void glCompressedTexSubImage3DOES_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
|
||||
void glFramebufferTexture3DOES_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
void glBindVertexArrayOES_enc(void *self , GLuint array);
|
||||
void glDeleteVertexArraysOES_enc(void *self , GLsizei n, const GLuint* arrays);
|
||||
void glGenVertexArraysOES_enc(void *self , GLsizei n, GLuint* arrays);
|
||||
GLboolean glIsVertexArrayOES_enc(void *self , GLuint array);
|
||||
void glDiscardFramebufferEXT_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments);
|
||||
void glMultiDrawArraysEXT_enc(void *self , GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
|
||||
void glMultiDrawElementsEXT_enc(void *self , GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
|
||||
void glGetPerfMonitorGroupsAMD_enc(void *self , GLint* numGroups, GLsizei groupsSize, GLuint* groups);
|
||||
void glGetPerfMonitorCountersAMD_enc(void *self , GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
|
||||
void glGetPerfMonitorGroupStringAMD_enc(void *self , GLuint group, GLsizei bufSize, GLsizei* length, GLchar* groupString);
|
||||
void glGetPerfMonitorCounterStringAMD_enc(void *self , GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar* counterString);
|
||||
void glGetPerfMonitorCounterInfoAMD_enc(void *self , GLuint group, GLuint counter, GLenum pname, GLvoid* data);
|
||||
void glGenPerfMonitorsAMD_enc(void *self , GLsizei n, GLuint* monitors);
|
||||
void glDeletePerfMonitorsAMD_enc(void *self , GLsizei n, GLuint* monitors);
|
||||
void glSelectPerfMonitorCountersAMD_enc(void *self , GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
|
||||
void glBeginPerfMonitorAMD_enc(void *self , GLuint monitor);
|
||||
void glEndPerfMonitorAMD_enc(void *self , GLuint monitor);
|
||||
void glGetPerfMonitorCounterDataAMD_enc(void *self , GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
|
||||
void glRenderbufferStorageMultisampleIMG_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glFramebufferTexture2DMultisampleIMG_enc(void *self , GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
void glDeleteFencesNV_enc(void *self , GLsizei n, const GLuint* fences);
|
||||
void glGenFencesNV_enc(void *self , GLsizei n, GLuint* fences);
|
||||
GLboolean glIsFenceNV_enc(void *self , GLuint fence);
|
||||
GLboolean glTestFenceNV_enc(void *self , GLuint fence);
|
||||
void glGetFenceivNV_enc(void *self , GLuint fence, GLenum pname, GLint* params);
|
||||
void glFinishFenceNV_enc(void *self , GLuint fence);
|
||||
void glSetFenceNV_enc(void *self , GLuint fence, GLenum condition);
|
||||
void glCoverageMaskNV_enc(void *self , GLboolean mask);
|
||||
void glCoverageOperationNV_enc(void *self , GLenum operation);
|
||||
void glGetDriverControlsQCOM_enc(void *self , GLint* num, GLsizei size, GLuint* driverControls);
|
||||
void glGetDriverControlStringQCOM_enc(void *self , GLuint driverControl, GLsizei bufSize, GLsizei* length, GLchar* driverControlString);
|
||||
void glEnableDriverControlQCOM_enc(void *self , GLuint driverControl);
|
||||
void glDisableDriverControlQCOM_enc(void *self , GLuint driverControl);
|
||||
void glExtGetTexturesQCOM_enc(void *self , GLuint* textures, GLint maxTextures, GLint* numTextures);
|
||||
void glExtGetBuffersQCOM_enc(void *self , GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
|
||||
void glExtGetRenderbuffersQCOM_enc(void *self , GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
|
||||
void glExtGetFramebuffersQCOM_enc(void *self , GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
|
||||
void glExtGetTexLevelParameterivQCOM_enc(void *self , GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
|
||||
void glExtTexObjectStateOverrideiQCOM_enc(void *self , GLenum target, GLenum pname, GLint param);
|
||||
void glExtGetTexSubImageQCOM_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* texels);
|
||||
void glExtGetBufferPointervQCOM_enc(void *self , GLenum target, GLvoidptr* params);
|
||||
void glExtGetShadersQCOM_enc(void *self , GLuint* shaders, GLint maxShaders, GLint* numShaders);
|
||||
void glExtGetProgramsQCOM_enc(void *self , GLuint* programs, GLint maxPrograms, GLint* numPrograms);
|
||||
GLboolean glExtIsProgramBinaryQCOM_enc(void *self , GLuint program);
|
||||
void glExtGetProgramBinarySourceQCOM_enc(void *self , GLuint program, GLenum shadertype, GLchar* source, GLint* length);
|
||||
void glStartTilingQCOM_enc(void *self , GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
|
||||
void glEndTilingQCOM_enc(void *self , GLbitfield preserveMask);
|
||||
void glVertexAttribPointerData_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void* data, GLuint datalen);
|
||||
void glVertexAttribPointerOffset_enc(void *self , GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint offset);
|
||||
void glDrawElementsOffset_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset);
|
||||
void glDrawElementsData_enc(void *self , GLenum mode, GLsizei count, GLenum type, void* data, GLuint datalen);
|
||||
void glGetCompressedTextureFormats_enc(void *self , int count, GLint* formats);
|
||||
void glShaderString_enc(void *self , GLuint shader, const GLchar* string, GLsizei len);
|
||||
int glFinishRoundTrip_enc(void *self );
|
||||
};
|
||||
#endif
|
||||
1483
tools/emulator/opengl/system/GLESv2_enc/gl2_entry.cpp
Normal file
1483
tools/emulator/opengl/system/GLESv2_enc/gl2_entry.cpp
Normal file
File diff suppressed because it is too large
Load Diff
216
tools/emulator/opengl/system/GLESv2_enc/gl2_ftable.h
Normal file
216
tools/emulator/opengl/system/GLESv2_enc/gl2_ftable.h
Normal file
@@ -0,0 +1,216 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __gl2_client_ftable_t_h
|
||||
#define __gl2_client_ftable_t_h
|
||||
|
||||
|
||||
static struct _gl2_funcs_by_name {
|
||||
const char *name;
|
||||
void *proc;
|
||||
} gl2_funcs_by_name[] = {
|
||||
{"glActiveTexture", (void*)glActiveTexture},
|
||||
{"glAttachShader", (void*)glAttachShader},
|
||||
{"glBindAttribLocation", (void*)glBindAttribLocation},
|
||||
{"glBindBuffer", (void*)glBindBuffer},
|
||||
{"glBindFramebuffer", (void*)glBindFramebuffer},
|
||||
{"glBindRenderbuffer", (void*)glBindRenderbuffer},
|
||||
{"glBindTexture", (void*)glBindTexture},
|
||||
{"glBlendColor", (void*)glBlendColor},
|
||||
{"glBlendEquation", (void*)glBlendEquation},
|
||||
{"glBlendEquationSeparate", (void*)glBlendEquationSeparate},
|
||||
{"glBlendFunc", (void*)glBlendFunc},
|
||||
{"glBlendFuncSeparate", (void*)glBlendFuncSeparate},
|
||||
{"glBufferData", (void*)glBufferData},
|
||||
{"glBufferSubData", (void*)glBufferSubData},
|
||||
{"glCheckFramebufferStatus", (void*)glCheckFramebufferStatus},
|
||||
{"glClear", (void*)glClear},
|
||||
{"glClearColor", (void*)glClearColor},
|
||||
{"glClearDepthf", (void*)glClearDepthf},
|
||||
{"glClearStencil", (void*)glClearStencil},
|
||||
{"glColorMask", (void*)glColorMask},
|
||||
{"glCompileShader", (void*)glCompileShader},
|
||||
{"glCompressedTexImage2D", (void*)glCompressedTexImage2D},
|
||||
{"glCompressedTexSubImage2D", (void*)glCompressedTexSubImage2D},
|
||||
{"glCopyTexImage2D", (void*)glCopyTexImage2D},
|
||||
{"glCopyTexSubImage2D", (void*)glCopyTexSubImage2D},
|
||||
{"glCreateProgram", (void*)glCreateProgram},
|
||||
{"glCreateShader", (void*)glCreateShader},
|
||||
{"glCullFace", (void*)glCullFace},
|
||||
{"glDeleteBuffers", (void*)glDeleteBuffers},
|
||||
{"glDeleteFramebuffers", (void*)glDeleteFramebuffers},
|
||||
{"glDeleteProgram", (void*)glDeleteProgram},
|
||||
{"glDeleteRenderbuffers", (void*)glDeleteRenderbuffers},
|
||||
{"glDeleteShader", (void*)glDeleteShader},
|
||||
{"glDeleteTextures", (void*)glDeleteTextures},
|
||||
{"glDepthFunc", (void*)glDepthFunc},
|
||||
{"glDepthMask", (void*)glDepthMask},
|
||||
{"glDepthRangef", (void*)glDepthRangef},
|
||||
{"glDetachShader", (void*)glDetachShader},
|
||||
{"glDisable", (void*)glDisable},
|
||||
{"glDisableVertexAttribArray", (void*)glDisableVertexAttribArray},
|
||||
{"glDrawArrays", (void*)glDrawArrays},
|
||||
{"glDrawElements", (void*)glDrawElements},
|
||||
{"glEnable", (void*)glEnable},
|
||||
{"glEnableVertexAttribArray", (void*)glEnableVertexAttribArray},
|
||||
{"glFinish", (void*)glFinish},
|
||||
{"glFlush", (void*)glFlush},
|
||||
{"glFramebufferRenderbuffer", (void*)glFramebufferRenderbuffer},
|
||||
{"glFramebufferTexture2D", (void*)glFramebufferTexture2D},
|
||||
{"glFrontFace", (void*)glFrontFace},
|
||||
{"glGenBuffers", (void*)glGenBuffers},
|
||||
{"glGenerateMipmap", (void*)glGenerateMipmap},
|
||||
{"glGenFramebuffers", (void*)glGenFramebuffers},
|
||||
{"glGenRenderbuffers", (void*)glGenRenderbuffers},
|
||||
{"glGenTextures", (void*)glGenTextures},
|
||||
{"glGetActiveAttrib", (void*)glGetActiveAttrib},
|
||||
{"glGetActiveUniform", (void*)glGetActiveUniform},
|
||||
{"glGetAttachedShaders", (void*)glGetAttachedShaders},
|
||||
{"glGetAttribLocation", (void*)glGetAttribLocation},
|
||||
{"glGetBooleanv", (void*)glGetBooleanv},
|
||||
{"glGetBufferParameteriv", (void*)glGetBufferParameteriv},
|
||||
{"glGetError", (void*)glGetError},
|
||||
{"glGetFloatv", (void*)glGetFloatv},
|
||||
{"glGetFramebufferAttachmentParameteriv", (void*)glGetFramebufferAttachmentParameteriv},
|
||||
{"glGetIntegerv", (void*)glGetIntegerv},
|
||||
{"glGetProgramiv", (void*)glGetProgramiv},
|
||||
{"glGetProgramInfoLog", (void*)glGetProgramInfoLog},
|
||||
{"glGetRenderbufferParameteriv", (void*)glGetRenderbufferParameteriv},
|
||||
{"glGetShaderiv", (void*)glGetShaderiv},
|
||||
{"glGetShaderInfoLog", (void*)glGetShaderInfoLog},
|
||||
{"glGetShaderPrecisionFormat", (void*)glGetShaderPrecisionFormat},
|
||||
{"glGetShaderSource", (void*)glGetShaderSource},
|
||||
{"glGetString", (void*)glGetString},
|
||||
{"glGetTexParameterfv", (void*)glGetTexParameterfv},
|
||||
{"glGetTexParameteriv", (void*)glGetTexParameteriv},
|
||||
{"glGetUniformfv", (void*)glGetUniformfv},
|
||||
{"glGetUniformiv", (void*)glGetUniformiv},
|
||||
{"glGetUniformLocation", (void*)glGetUniformLocation},
|
||||
{"glGetVertexAttribfv", (void*)glGetVertexAttribfv},
|
||||
{"glGetVertexAttribiv", (void*)glGetVertexAttribiv},
|
||||
{"glGetVertexAttribPointerv", (void*)glGetVertexAttribPointerv},
|
||||
{"glHint", (void*)glHint},
|
||||
{"glIsBuffer", (void*)glIsBuffer},
|
||||
{"glIsEnabled", (void*)glIsEnabled},
|
||||
{"glIsFramebuffer", (void*)glIsFramebuffer},
|
||||
{"glIsProgram", (void*)glIsProgram},
|
||||
{"glIsRenderbuffer", (void*)glIsRenderbuffer},
|
||||
{"glIsShader", (void*)glIsShader},
|
||||
{"glIsTexture", (void*)glIsTexture},
|
||||
{"glLineWidth", (void*)glLineWidth},
|
||||
{"glLinkProgram", (void*)glLinkProgram},
|
||||
{"glPixelStorei", (void*)glPixelStorei},
|
||||
{"glPolygonOffset", (void*)glPolygonOffset},
|
||||
{"glReadPixels", (void*)glReadPixels},
|
||||
{"glReleaseShaderCompiler", (void*)glReleaseShaderCompiler},
|
||||
{"glRenderbufferStorage", (void*)glRenderbufferStorage},
|
||||
{"glSampleCoverage", (void*)glSampleCoverage},
|
||||
{"glScissor", (void*)glScissor},
|
||||
{"glShaderBinary", (void*)glShaderBinary},
|
||||
{"glShaderSource", (void*)glShaderSource},
|
||||
{"glStencilFunc", (void*)glStencilFunc},
|
||||
{"glStencilFuncSeparate", (void*)glStencilFuncSeparate},
|
||||
{"glStencilMask", (void*)glStencilMask},
|
||||
{"glStencilMaskSeparate", (void*)glStencilMaskSeparate},
|
||||
{"glStencilOp", (void*)glStencilOp},
|
||||
{"glStencilOpSeparate", (void*)glStencilOpSeparate},
|
||||
{"glTexImage2D", (void*)glTexImage2D},
|
||||
{"glTexParameterf", (void*)glTexParameterf},
|
||||
{"glTexParameterfv", (void*)glTexParameterfv},
|
||||
{"glTexParameteri", (void*)glTexParameteri},
|
||||
{"glTexParameteriv", (void*)glTexParameteriv},
|
||||
{"glTexSubImage2D", (void*)glTexSubImage2D},
|
||||
{"glUniform1f", (void*)glUniform1f},
|
||||
{"glUniform1fv", (void*)glUniform1fv},
|
||||
{"glUniform1i", (void*)glUniform1i},
|
||||
{"glUniform1iv", (void*)glUniform1iv},
|
||||
{"glUniform2f", (void*)glUniform2f},
|
||||
{"glUniform2fv", (void*)glUniform2fv},
|
||||
{"glUniform2i", (void*)glUniform2i},
|
||||
{"glUniform2iv", (void*)glUniform2iv},
|
||||
{"glUniform3f", (void*)glUniform3f},
|
||||
{"glUniform3fv", (void*)glUniform3fv},
|
||||
{"glUniform3i", (void*)glUniform3i},
|
||||
{"glUniform3iv", (void*)glUniform3iv},
|
||||
{"glUniform4f", (void*)glUniform4f},
|
||||
{"glUniform4fv", (void*)glUniform4fv},
|
||||
{"glUniform4i", (void*)glUniform4i},
|
||||
{"glUniform4iv", (void*)glUniform4iv},
|
||||
{"glUniformMatrix2fv", (void*)glUniformMatrix2fv},
|
||||
{"glUniformMatrix3fv", (void*)glUniformMatrix3fv},
|
||||
{"glUniformMatrix4fv", (void*)glUniformMatrix4fv},
|
||||
{"glUseProgram", (void*)glUseProgram},
|
||||
{"glValidateProgram", (void*)glValidateProgram},
|
||||
{"glVertexAttrib1f", (void*)glVertexAttrib1f},
|
||||
{"glVertexAttrib1fv", (void*)glVertexAttrib1fv},
|
||||
{"glVertexAttrib2f", (void*)glVertexAttrib2f},
|
||||
{"glVertexAttrib2fv", (void*)glVertexAttrib2fv},
|
||||
{"glVertexAttrib3f", (void*)glVertexAttrib3f},
|
||||
{"glVertexAttrib3fv", (void*)glVertexAttrib3fv},
|
||||
{"glVertexAttrib4f", (void*)glVertexAttrib4f},
|
||||
{"glVertexAttrib4fv", (void*)glVertexAttrib4fv},
|
||||
{"glVertexAttribPointer", (void*)glVertexAttribPointer},
|
||||
{"glViewport", (void*)glViewport},
|
||||
{"glEGLImageTargetTexture2DOES", (void*)glEGLImageTargetTexture2DOES},
|
||||
{"glEGLImageTargetRenderbufferStorageOES", (void*)glEGLImageTargetRenderbufferStorageOES},
|
||||
{"glGetProgramBinaryOES", (void*)glGetProgramBinaryOES},
|
||||
{"glProgramBinaryOES", (void*)glProgramBinaryOES},
|
||||
{"glMapBufferOES", (void*)glMapBufferOES},
|
||||
{"glUnmapBufferOES", (void*)glUnmapBufferOES},
|
||||
{"glTexImage3DOES", (void*)glTexImage3DOES},
|
||||
{"glTexSubImage3DOES", (void*)glTexSubImage3DOES},
|
||||
{"glCopyTexSubImage3DOES", (void*)glCopyTexSubImage3DOES},
|
||||
{"glCompressedTexImage3DOES", (void*)glCompressedTexImage3DOES},
|
||||
{"glCompressedTexSubImage3DOES", (void*)glCompressedTexSubImage3DOES},
|
||||
{"glFramebufferTexture3DOES", (void*)glFramebufferTexture3DOES},
|
||||
{"glBindVertexArrayOES", (void*)glBindVertexArrayOES},
|
||||
{"glDeleteVertexArraysOES", (void*)glDeleteVertexArraysOES},
|
||||
{"glGenVertexArraysOES", (void*)glGenVertexArraysOES},
|
||||
{"glIsVertexArrayOES", (void*)glIsVertexArrayOES},
|
||||
{"glDiscardFramebufferEXT", (void*)glDiscardFramebufferEXT},
|
||||
{"glMultiDrawArraysEXT", (void*)glMultiDrawArraysEXT},
|
||||
{"glMultiDrawElementsEXT", (void*)glMultiDrawElementsEXT},
|
||||
{"glGetPerfMonitorGroupsAMD", (void*)glGetPerfMonitorGroupsAMD},
|
||||
{"glGetPerfMonitorCountersAMD", (void*)glGetPerfMonitorCountersAMD},
|
||||
{"glGetPerfMonitorGroupStringAMD", (void*)glGetPerfMonitorGroupStringAMD},
|
||||
{"glGetPerfMonitorCounterStringAMD", (void*)glGetPerfMonitorCounterStringAMD},
|
||||
{"glGetPerfMonitorCounterInfoAMD", (void*)glGetPerfMonitorCounterInfoAMD},
|
||||
{"glGenPerfMonitorsAMD", (void*)glGenPerfMonitorsAMD},
|
||||
{"glDeletePerfMonitorsAMD", (void*)glDeletePerfMonitorsAMD},
|
||||
{"glSelectPerfMonitorCountersAMD", (void*)glSelectPerfMonitorCountersAMD},
|
||||
{"glBeginPerfMonitorAMD", (void*)glBeginPerfMonitorAMD},
|
||||
{"glEndPerfMonitorAMD", (void*)glEndPerfMonitorAMD},
|
||||
{"glGetPerfMonitorCounterDataAMD", (void*)glGetPerfMonitorCounterDataAMD},
|
||||
{"glRenderbufferStorageMultisampleIMG", (void*)glRenderbufferStorageMultisampleIMG},
|
||||
{"glFramebufferTexture2DMultisampleIMG", (void*)glFramebufferTexture2DMultisampleIMG},
|
||||
{"glDeleteFencesNV", (void*)glDeleteFencesNV},
|
||||
{"glGenFencesNV", (void*)glGenFencesNV},
|
||||
{"glIsFenceNV", (void*)glIsFenceNV},
|
||||
{"glTestFenceNV", (void*)glTestFenceNV},
|
||||
{"glGetFenceivNV", (void*)glGetFenceivNV},
|
||||
{"glFinishFenceNV", (void*)glFinishFenceNV},
|
||||
{"glSetFenceNV", (void*)glSetFenceNV},
|
||||
{"glCoverageMaskNV", (void*)glCoverageMaskNV},
|
||||
{"glCoverageOperationNV", (void*)glCoverageOperationNV},
|
||||
{"glGetDriverControlsQCOM", (void*)glGetDriverControlsQCOM},
|
||||
{"glGetDriverControlStringQCOM", (void*)glGetDriverControlStringQCOM},
|
||||
{"glEnableDriverControlQCOM", (void*)glEnableDriverControlQCOM},
|
||||
{"glDisableDriverControlQCOM", (void*)glDisableDriverControlQCOM},
|
||||
{"glExtGetTexturesQCOM", (void*)glExtGetTexturesQCOM},
|
||||
{"glExtGetBuffersQCOM", (void*)glExtGetBuffersQCOM},
|
||||
{"glExtGetRenderbuffersQCOM", (void*)glExtGetRenderbuffersQCOM},
|
||||
{"glExtGetFramebuffersQCOM", (void*)glExtGetFramebuffersQCOM},
|
||||
{"glExtGetTexLevelParameterivQCOM", (void*)glExtGetTexLevelParameterivQCOM},
|
||||
{"glExtTexObjectStateOverrideiQCOM", (void*)glExtTexObjectStateOverrideiQCOM},
|
||||
{"glExtGetTexSubImageQCOM", (void*)glExtGetTexSubImageQCOM},
|
||||
{"glExtGetBufferPointervQCOM", (void*)glExtGetBufferPointervQCOM},
|
||||
{"glExtGetShadersQCOM", (void*)glExtGetShadersQCOM},
|
||||
{"glExtGetProgramsQCOM", (void*)glExtGetProgramsQCOM},
|
||||
{"glExtIsProgramBinaryQCOM", (void*)glExtIsProgramBinaryQCOM},
|
||||
{"glExtGetProgramBinarySourceQCOM", (void*)glExtGetProgramBinarySourceQCOM},
|
||||
{"glStartTilingQCOM", (void*)glStartTilingQCOM},
|
||||
{"glEndTilingQCOM", (void*)glEndTilingQCOM},
|
||||
};
|
||||
static int gl2_num_funcs = sizeof(gl2_funcs_by_name) / sizeof(struct _gl2_funcs_by_name);
|
||||
|
||||
|
||||
#endif
|
||||
217
tools/emulator/opengl/system/GLESv2_enc/gl2_opcodes.h
Normal file
217
tools/emulator/opengl/system/GLESv2_enc/gl2_opcodes.h
Normal file
@@ -0,0 +1,217 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __GUARD_gl2_opcodes_h_
|
||||
#define __GUARD_gl2_opcodes_h_
|
||||
|
||||
#define OP_glActiveTexture 2048
|
||||
#define OP_glAttachShader 2049
|
||||
#define OP_glBindAttribLocation 2050
|
||||
#define OP_glBindBuffer 2051
|
||||
#define OP_glBindFramebuffer 2052
|
||||
#define OP_glBindRenderbuffer 2053
|
||||
#define OP_glBindTexture 2054
|
||||
#define OP_glBlendColor 2055
|
||||
#define OP_glBlendEquation 2056
|
||||
#define OP_glBlendEquationSeparate 2057
|
||||
#define OP_glBlendFunc 2058
|
||||
#define OP_glBlendFuncSeparate 2059
|
||||
#define OP_glBufferData 2060
|
||||
#define OP_glBufferSubData 2061
|
||||
#define OP_glCheckFramebufferStatus 2062
|
||||
#define OP_glClear 2063
|
||||
#define OP_glClearColor 2064
|
||||
#define OP_glClearDepthf 2065
|
||||
#define OP_glClearStencil 2066
|
||||
#define OP_glColorMask 2067
|
||||
#define OP_glCompileShader 2068
|
||||
#define OP_glCompressedTexImage2D 2069
|
||||
#define OP_glCompressedTexSubImage2D 2070
|
||||
#define OP_glCopyTexImage2D 2071
|
||||
#define OP_glCopyTexSubImage2D 2072
|
||||
#define OP_glCreateProgram 2073
|
||||
#define OP_glCreateShader 2074
|
||||
#define OP_glCullFace 2075
|
||||
#define OP_glDeleteBuffers 2076
|
||||
#define OP_glDeleteFramebuffers 2077
|
||||
#define OP_glDeleteProgram 2078
|
||||
#define OP_glDeleteRenderbuffers 2079
|
||||
#define OP_glDeleteShader 2080
|
||||
#define OP_glDeleteTextures 2081
|
||||
#define OP_glDepthFunc 2082
|
||||
#define OP_glDepthMask 2083
|
||||
#define OP_glDepthRangef 2084
|
||||
#define OP_glDetachShader 2085
|
||||
#define OP_glDisable 2086
|
||||
#define OP_glDisableVertexAttribArray 2087
|
||||
#define OP_glDrawArrays 2088
|
||||
#define OP_glDrawElements 2089
|
||||
#define OP_glEnable 2090
|
||||
#define OP_glEnableVertexAttribArray 2091
|
||||
#define OP_glFinish 2092
|
||||
#define OP_glFlush 2093
|
||||
#define OP_glFramebufferRenderbuffer 2094
|
||||
#define OP_glFramebufferTexture2D 2095
|
||||
#define OP_glFrontFace 2096
|
||||
#define OP_glGenBuffers 2097
|
||||
#define OP_glGenerateMipmap 2098
|
||||
#define OP_glGenFramebuffers 2099
|
||||
#define OP_glGenRenderbuffers 2100
|
||||
#define OP_glGenTextures 2101
|
||||
#define OP_glGetActiveAttrib 2102
|
||||
#define OP_glGetActiveUniform 2103
|
||||
#define OP_glGetAttachedShaders 2104
|
||||
#define OP_glGetAttribLocation 2105
|
||||
#define OP_glGetBooleanv 2106
|
||||
#define OP_glGetBufferParameteriv 2107
|
||||
#define OP_glGetError 2108
|
||||
#define OP_glGetFloatv 2109
|
||||
#define OP_glGetFramebufferAttachmentParameteriv 2110
|
||||
#define OP_glGetIntegerv 2111
|
||||
#define OP_glGetProgramiv 2112
|
||||
#define OP_glGetProgramInfoLog 2113
|
||||
#define OP_glGetRenderbufferParameteriv 2114
|
||||
#define OP_glGetShaderiv 2115
|
||||
#define OP_glGetShaderInfoLog 2116
|
||||
#define OP_glGetShaderPrecisionFormat 2117
|
||||
#define OP_glGetShaderSource 2118
|
||||
#define OP_glGetString 2119
|
||||
#define OP_glGetTexParameterfv 2120
|
||||
#define OP_glGetTexParameteriv 2121
|
||||
#define OP_glGetUniformfv 2122
|
||||
#define OP_glGetUniformiv 2123
|
||||
#define OP_glGetUniformLocation 2124
|
||||
#define OP_glGetVertexAttribfv 2125
|
||||
#define OP_glGetVertexAttribiv 2126
|
||||
#define OP_glGetVertexAttribPointerv 2127
|
||||
#define OP_glHint 2128
|
||||
#define OP_glIsBuffer 2129
|
||||
#define OP_glIsEnabled 2130
|
||||
#define OP_glIsFramebuffer 2131
|
||||
#define OP_glIsProgram 2132
|
||||
#define OP_glIsRenderbuffer 2133
|
||||
#define OP_glIsShader 2134
|
||||
#define OP_glIsTexture 2135
|
||||
#define OP_glLineWidth 2136
|
||||
#define OP_glLinkProgram 2137
|
||||
#define OP_glPixelStorei 2138
|
||||
#define OP_glPolygonOffset 2139
|
||||
#define OP_glReadPixels 2140
|
||||
#define OP_glReleaseShaderCompiler 2141
|
||||
#define OP_glRenderbufferStorage 2142
|
||||
#define OP_glSampleCoverage 2143
|
||||
#define OP_glScissor 2144
|
||||
#define OP_glShaderBinary 2145
|
||||
#define OP_glShaderSource 2146
|
||||
#define OP_glStencilFunc 2147
|
||||
#define OP_glStencilFuncSeparate 2148
|
||||
#define OP_glStencilMask 2149
|
||||
#define OP_glStencilMaskSeparate 2150
|
||||
#define OP_glStencilOp 2151
|
||||
#define OP_glStencilOpSeparate 2152
|
||||
#define OP_glTexImage2D 2153
|
||||
#define OP_glTexParameterf 2154
|
||||
#define OP_glTexParameterfv 2155
|
||||
#define OP_glTexParameteri 2156
|
||||
#define OP_glTexParameteriv 2157
|
||||
#define OP_glTexSubImage2D 2158
|
||||
#define OP_glUniform1f 2159
|
||||
#define OP_glUniform1fv 2160
|
||||
#define OP_glUniform1i 2161
|
||||
#define OP_glUniform1iv 2162
|
||||
#define OP_glUniform2f 2163
|
||||
#define OP_glUniform2fv 2164
|
||||
#define OP_glUniform2i 2165
|
||||
#define OP_glUniform2iv 2166
|
||||
#define OP_glUniform3f 2167
|
||||
#define OP_glUniform3fv 2168
|
||||
#define OP_glUniform3i 2169
|
||||
#define OP_glUniform3iv 2170
|
||||
#define OP_glUniform4f 2171
|
||||
#define OP_glUniform4fv 2172
|
||||
#define OP_glUniform4i 2173
|
||||
#define OP_glUniform4iv 2174
|
||||
#define OP_glUniformMatrix2fv 2175
|
||||
#define OP_glUniformMatrix3fv 2176
|
||||
#define OP_glUniformMatrix4fv 2177
|
||||
#define OP_glUseProgram 2178
|
||||
#define OP_glValidateProgram 2179
|
||||
#define OP_glVertexAttrib1f 2180
|
||||
#define OP_glVertexAttrib1fv 2181
|
||||
#define OP_glVertexAttrib2f 2182
|
||||
#define OP_glVertexAttrib2fv 2183
|
||||
#define OP_glVertexAttrib3f 2184
|
||||
#define OP_glVertexAttrib3fv 2185
|
||||
#define OP_glVertexAttrib4f 2186
|
||||
#define OP_glVertexAttrib4fv 2187
|
||||
#define OP_glVertexAttribPointer 2188
|
||||
#define OP_glViewport 2189
|
||||
#define OP_glEGLImageTargetTexture2DOES 2190
|
||||
#define OP_glEGLImageTargetRenderbufferStorageOES 2191
|
||||
#define OP_glGetProgramBinaryOES 2192
|
||||
#define OP_glProgramBinaryOES 2193
|
||||
#define OP_glMapBufferOES 2194
|
||||
#define OP_glUnmapBufferOES 2195
|
||||
#define OP_glTexImage3DOES 2196
|
||||
#define OP_glTexSubImage3DOES 2197
|
||||
#define OP_glCopyTexSubImage3DOES 2198
|
||||
#define OP_glCompressedTexImage3DOES 2199
|
||||
#define OP_glCompressedTexSubImage3DOES 2200
|
||||
#define OP_glFramebufferTexture3DOES 2201
|
||||
#define OP_glBindVertexArrayOES 2202
|
||||
#define OP_glDeleteVertexArraysOES 2203
|
||||
#define OP_glGenVertexArraysOES 2204
|
||||
#define OP_glIsVertexArrayOES 2205
|
||||
#define OP_glDiscardFramebufferEXT 2206
|
||||
#define OP_glMultiDrawArraysEXT 2207
|
||||
#define OP_glMultiDrawElementsEXT 2208
|
||||
#define OP_glGetPerfMonitorGroupsAMD 2209
|
||||
#define OP_glGetPerfMonitorCountersAMD 2210
|
||||
#define OP_glGetPerfMonitorGroupStringAMD 2211
|
||||
#define OP_glGetPerfMonitorCounterStringAMD 2212
|
||||
#define OP_glGetPerfMonitorCounterInfoAMD 2213
|
||||
#define OP_glGenPerfMonitorsAMD 2214
|
||||
#define OP_glDeletePerfMonitorsAMD 2215
|
||||
#define OP_glSelectPerfMonitorCountersAMD 2216
|
||||
#define OP_glBeginPerfMonitorAMD 2217
|
||||
#define OP_glEndPerfMonitorAMD 2218
|
||||
#define OP_glGetPerfMonitorCounterDataAMD 2219
|
||||
#define OP_glRenderbufferStorageMultisampleIMG 2220
|
||||
#define OP_glFramebufferTexture2DMultisampleIMG 2221
|
||||
#define OP_glDeleteFencesNV 2222
|
||||
#define OP_glGenFencesNV 2223
|
||||
#define OP_glIsFenceNV 2224
|
||||
#define OP_glTestFenceNV 2225
|
||||
#define OP_glGetFenceivNV 2226
|
||||
#define OP_glFinishFenceNV 2227
|
||||
#define OP_glSetFenceNV 2228
|
||||
#define OP_glCoverageMaskNV 2229
|
||||
#define OP_glCoverageOperationNV 2230
|
||||
#define OP_glGetDriverControlsQCOM 2231
|
||||
#define OP_glGetDriverControlStringQCOM 2232
|
||||
#define OP_glEnableDriverControlQCOM 2233
|
||||
#define OP_glDisableDriverControlQCOM 2234
|
||||
#define OP_glExtGetTexturesQCOM 2235
|
||||
#define OP_glExtGetBuffersQCOM 2236
|
||||
#define OP_glExtGetRenderbuffersQCOM 2237
|
||||
#define OP_glExtGetFramebuffersQCOM 2238
|
||||
#define OP_glExtGetTexLevelParameterivQCOM 2239
|
||||
#define OP_glExtTexObjectStateOverrideiQCOM 2240
|
||||
#define OP_glExtGetTexSubImageQCOM 2241
|
||||
#define OP_glExtGetBufferPointervQCOM 2242
|
||||
#define OP_glExtGetShadersQCOM 2243
|
||||
#define OP_glExtGetProgramsQCOM 2244
|
||||
#define OP_glExtIsProgramBinaryQCOM 2245
|
||||
#define OP_glExtGetProgramBinarySourceQCOM 2246
|
||||
#define OP_glStartTilingQCOM 2247
|
||||
#define OP_glEndTilingQCOM 2248
|
||||
#define OP_glVertexAttribPointerData 2249
|
||||
#define OP_glVertexAttribPointerOffset 2250
|
||||
#define OP_glDrawElementsOffset 2251
|
||||
#define OP_glDrawElementsData 2252
|
||||
#define OP_glGetCompressedTextureFormats 2253
|
||||
#define OP_glShaderString 2254
|
||||
#define OP_glFinishRoundTrip 2255
|
||||
#define OP_last 2256
|
||||
|
||||
|
||||
#endif
|
||||
21
tools/emulator/opengl/system/GLESv2_enc/gl2_types.h
Normal file
21
tools/emulator/opengl/system/GLESv2_enc/gl2_types.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _GL_2_TYPES_H_
|
||||
#define _GL_2_TYPES_H_
|
||||
#include "gl_base_types.h"
|
||||
|
||||
typedef void *GLvoidptr;
|
||||
#endif
|
||||
13
tools/emulator/opengl/system/OpenglSystemCommon/Android.mk
Normal file
13
tools/emulator/opengl/system/OpenglSystemCommon/Android.mk
Normal file
@@ -0,0 +1,13 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
$(call emugl-begin-shared-library,libOpenglSystemCommon)
|
||||
$(call emugl-import,libGLESv1_enc libGLESv2_enc lib_renderControl_enc)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
HostConnection.cpp \
|
||||
QemuPipeStream.cpp \
|
||||
ThreadInfo.cpp
|
||||
|
||||
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH) bionic/libc/private)
|
||||
|
||||
$(call emugl-end-module)
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _SYSTEM_COMMON_EGL_CLIENT_IFACE_H
|
||||
#define _SYSTEM_COMMON_EGL_CLIENT_IFACE_H
|
||||
|
||||
struct EGLThreadInfo; // defined in ThreadInfo.h
|
||||
|
||||
typedef struct {
|
||||
EGLThreadInfo* (*getThreadInfo)();
|
||||
const char* (*getGLString)(int glEnum);
|
||||
} EGLClient_eglInterface;
|
||||
|
||||
typedef struct {
|
||||
void* (*getProcAddress)(const char *funcName);
|
||||
void (*init)();
|
||||
void (*finish)();
|
||||
} EGLClient_glesInterface;
|
||||
|
||||
//
|
||||
// Any GLES/GLES2 client API library should define a function named "init_emul_gles"
|
||||
// with the following prototype,
|
||||
// It will be called by EGL after loading the GLES library for initialization
|
||||
// and exchanging interface function pointers.
|
||||
//
|
||||
typedef EGLClient_glesInterface *(*init_emul_gles_t)(EGLClient_eglInterface *eglIface);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "HostConnection.h"
|
||||
#include "TcpStream.h"
|
||||
#include "QemuPipeStream.h"
|
||||
#include "ThreadInfo.h"
|
||||
#include <cutils/log.h>
|
||||
#include "GLEncoder.h"
|
||||
#include "GL2Encoder.h"
|
||||
|
||||
#define STREAM_BUFFER_SIZE 4*1024*1024
|
||||
#define STREAM_PORT_NUM 22468
|
||||
|
||||
/* Set to 1 to use a QEMU pipe, or 0 for a TCP connection */
|
||||
#define USE_QEMU_PIPE 1
|
||||
|
||||
HostConnection::HostConnection() :
|
||||
m_stream(NULL),
|
||||
m_glEnc(NULL),
|
||||
m_gl2Enc(NULL),
|
||||
m_rcEnc(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
HostConnection::~HostConnection()
|
||||
{
|
||||
delete m_stream;
|
||||
delete m_glEnc;
|
||||
delete m_gl2Enc;
|
||||
delete m_rcEnc;
|
||||
}
|
||||
|
||||
HostConnection *HostConnection::get()
|
||||
{
|
||||
/* TODO: Make this configurable with a system property */
|
||||
const int useQemuPipe = USE_QEMU_PIPE;
|
||||
|
||||
// Get thread info
|
||||
EGLThreadInfo *tinfo = getEGLThreadInfo();
|
||||
if (!tinfo) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (tinfo->hostConn == NULL) {
|
||||
HostConnection *con = new HostConnection();
|
||||
if (NULL == con) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (useQemuPipe) {
|
||||
QemuPipeStream *stream = new QemuPipeStream(STREAM_BUFFER_SIZE);
|
||||
if (!stream) {
|
||||
ALOGE("Failed to create QemuPipeStream for host connection!!!\n");
|
||||
delete con;
|
||||
return NULL;
|
||||
}
|
||||
if (stream->connect() < 0) {
|
||||
ALOGE("Failed to connect to host (QemuPipeStream)!!!\n");
|
||||
delete stream;
|
||||
delete con;
|
||||
return NULL;
|
||||
}
|
||||
con->m_stream = stream;
|
||||
}
|
||||
else /* !useQemuPipe */
|
||||
{
|
||||
TcpStream *stream = new TcpStream(STREAM_BUFFER_SIZE);
|
||||
if (!stream) {
|
||||
ALOGE("Failed to create TcpStream for host connection!!!\n");
|
||||
delete con;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (stream->connect("10.0.2.2", STREAM_PORT_NUM) < 0) {
|
||||
ALOGE("Failed to connect to host (TcpStream)!!!\n");
|
||||
delete stream;
|
||||
delete con;
|
||||
return NULL;
|
||||
}
|
||||
con->m_stream = stream;
|
||||
}
|
||||
|
||||
// send zero 'clientFlags' to the host.
|
||||
unsigned int *pClientFlags =
|
||||
(unsigned int *)con->m_stream->allocBuffer(sizeof(unsigned int));
|
||||
*pClientFlags = 0;
|
||||
con->m_stream->commitBuffer(sizeof(unsigned int));
|
||||
|
||||
ALOGD("HostConnection::get() New Host Connection established %p, tid %d\n", con, gettid());
|
||||
tinfo->hostConn = con;
|
||||
}
|
||||
|
||||
return tinfo->hostConn;
|
||||
}
|
||||
|
||||
GLEncoder *HostConnection::glEncoder()
|
||||
{
|
||||
if (!m_glEnc) {
|
||||
m_glEnc = new GLEncoder(m_stream);
|
||||
DBG("HostConnection::glEncoder new encoder %p, tid %d", m_glEnc, gettid());
|
||||
m_glEnc->setContextAccessor(s_getGLContext);
|
||||
}
|
||||
return m_glEnc;
|
||||
}
|
||||
|
||||
GL2Encoder *HostConnection::gl2Encoder()
|
||||
{
|
||||
if (!m_gl2Enc) {
|
||||
m_gl2Enc = new GL2Encoder(m_stream);
|
||||
DBG("HostConnection::gl2Encoder new encoder %p, tid %d", m_gl2Enc, gettid());
|
||||
m_gl2Enc->setContextAccessor(s_getGL2Context);
|
||||
}
|
||||
return m_gl2Enc;
|
||||
}
|
||||
|
||||
renderControl_encoder_context_t *HostConnection::rcEncoder()
|
||||
{
|
||||
if (!m_rcEnc) {
|
||||
m_rcEnc = new renderControl_encoder_context_t(m_stream);
|
||||
}
|
||||
return m_rcEnc;
|
||||
}
|
||||
|
||||
gl_client_context_t *HostConnection::s_getGLContext()
|
||||
{
|
||||
EGLThreadInfo *ti = getEGLThreadInfo();
|
||||
if (ti->hostConn) {
|
||||
return ti->hostConn->m_glEnc;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gl2_client_context_t *HostConnection::s_getGL2Context()
|
||||
{
|
||||
EGLThreadInfo *ti = getEGLThreadInfo();
|
||||
if (ti->hostConn) {
|
||||
return ti->hostConn->m_gl2Enc;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __COMMON_HOST_CONNECTION_H
|
||||
#define __COMMON_HOST_CONNECTION_H
|
||||
|
||||
#include "IOStream.h"
|
||||
#include "renderControl_enc.h"
|
||||
|
||||
class GLEncoder;
|
||||
class gl_client_context_t;
|
||||
class GL2Encoder;
|
||||
class gl2_client_context_t;
|
||||
|
||||
class HostConnection
|
||||
{
|
||||
public:
|
||||
static HostConnection *get();
|
||||
~HostConnection();
|
||||
|
||||
GLEncoder *glEncoder();
|
||||
GL2Encoder *gl2Encoder();
|
||||
renderControl_encoder_context_t *rcEncoder();
|
||||
|
||||
void flush() {
|
||||
if (m_stream) {
|
||||
m_stream->flush();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
HostConnection();
|
||||
static gl_client_context_t *s_getGLContext();
|
||||
static gl2_client_context_t *s_getGL2Context();
|
||||
|
||||
private:
|
||||
IOStream *m_stream;
|
||||
GLEncoder *m_glEnc;
|
||||
GL2Encoder *m_gl2Enc;
|
||||
renderControl_encoder_context_t *m_rcEnc;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "QemuPipeStream.h"
|
||||
#include <hardware/qemu_pipe.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
QemuPipeStream::QemuPipeStream(size_t bufSize) :
|
||||
IOStream(bufSize),
|
||||
m_sock(-1),
|
||||
m_bufsize(bufSize),
|
||||
m_buf(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
QemuPipeStream::QemuPipeStream(int sock, size_t bufSize) :
|
||||
IOStream(bufSize),
|
||||
m_sock(sock),
|
||||
m_bufsize(bufSize),
|
||||
m_buf(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
QemuPipeStream::~QemuPipeStream()
|
||||
{
|
||||
if (m_sock >= 0) {
|
||||
::close(m_sock);
|
||||
}
|
||||
if (m_buf != NULL) {
|
||||
free(m_buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int QemuPipeStream::connect(void)
|
||||
{
|
||||
m_sock = qemu_pipe_open("opengles");
|
||||
if (!valid()) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *QemuPipeStream::allocBuffer(size_t minSize)
|
||||
{
|
||||
size_t allocSize = (m_bufsize < minSize ? minSize : m_bufsize);
|
||||
if (!m_buf) {
|
||||
m_buf = (unsigned char *)malloc(allocSize);
|
||||
}
|
||||
else if (m_bufsize < allocSize) {
|
||||
unsigned char *p = (unsigned char *)realloc(m_buf, allocSize);
|
||||
if (p != NULL) {
|
||||
m_buf = p;
|
||||
m_bufsize = allocSize;
|
||||
} else {
|
||||
ERR("realloc (%d) failed\n", allocSize);
|
||||
free(m_buf);
|
||||
m_buf = NULL;
|
||||
m_bufsize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return m_buf;
|
||||
};
|
||||
|
||||
int QemuPipeStream::commitBuffer(size_t size)
|
||||
{
|
||||
return writeFully(m_buf, size);
|
||||
}
|
||||
|
||||
int QemuPipeStream::writeFully(const void *buf, size_t len)
|
||||
{
|
||||
//DBG(">> QemuPipeStream::writeFully %d\n", len);
|
||||
if (!valid()) return -1;
|
||||
|
||||
size_t res = len;
|
||||
int retval = 0;
|
||||
|
||||
while (res > 0) {
|
||||
ssize_t stat = ::write(m_sock, (const char *)(buf) + (len - res), res);
|
||||
if (stat > 0) {
|
||||
res -= stat;
|
||||
continue;
|
||||
}
|
||||
if (stat == 0) { /* EOF */
|
||||
ERR("QemuPipeStream::writeFully failed: premature EOF\n");
|
||||
retval = -1;
|
||||
break;
|
||||
}
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
retval = stat;
|
||||
ERR("QemuPipeStream::writeFully failed: %s\n", strerror(errno));
|
||||
break;
|
||||
}
|
||||
//DBG("<< QemuPipeStream::writeFully %d\n", len );
|
||||
return retval;
|
||||
}
|
||||
|
||||
const unsigned char *QemuPipeStream::readFully(void *buf, size_t len)
|
||||
{
|
||||
//DBG(">> QemuPipeStream::readFully %d\n", len);
|
||||
if (!valid()) return NULL;
|
||||
if (!buf) {
|
||||
if (len>0) ERR("QemuPipeStream::readFully failed, buf=NULL, len %d", len);
|
||||
return NULL; // do not allow NULL buf in that implementation
|
||||
}
|
||||
size_t res = len;
|
||||
while (res > 0) {
|
||||
ssize_t stat = ::read(m_sock, (char *)(buf) + len - res, len);
|
||||
if (stat == 0) {
|
||||
// client shutdown;
|
||||
return NULL;
|
||||
} else if (stat < 0) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
} else {
|
||||
ERR("QemuPipeStream::readFully failed (buf %p): %s\n",
|
||||
buf, strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
res -= stat;
|
||||
}
|
||||
}
|
||||
//DBG("<< QemuPipeStream::readFully %d\n", len);
|
||||
return (const unsigned char *)buf;
|
||||
}
|
||||
|
||||
const unsigned char *QemuPipeStream::read( void *buf, size_t *inout_len)
|
||||
{
|
||||
//DBG(">> QemuPipeStream::read %d\n", *inout_len);
|
||||
if (!valid()) return NULL;
|
||||
if (!buf) {
|
||||
ERR("QemuPipeStream::read failed, buf=NULL");
|
||||
return NULL; // do not allow NULL buf in that implementation
|
||||
}
|
||||
|
||||
int n = recv(buf, *inout_len);
|
||||
|
||||
if (n > 0) {
|
||||
*inout_len = n;
|
||||
return (const unsigned char *)buf;
|
||||
}
|
||||
|
||||
//DBG("<< QemuPipeStream::read %d\n", *inout_len);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int QemuPipeStream::recv(void *buf, size_t len)
|
||||
{
|
||||
if (!valid()) return int(ERR_INVALID_SOCKET);
|
||||
char* p = (char *)buf;
|
||||
int ret = 0;
|
||||
while(len > 0) {
|
||||
int res = ::read(m_sock, p, len);
|
||||
if (res > 0) {
|
||||
p += res;
|
||||
ret += res;
|
||||
len -= res;
|
||||
continue;
|
||||
}
|
||||
if (res == 0) { /* EOF */
|
||||
break;
|
||||
}
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
|
||||
/* A real error */
|
||||
if (ret == 0)
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef __QEMU_PIPE_STREAM_H
|
||||
#define __QEMU_PIPE_STREAM_H
|
||||
|
||||
/* This file implements an IOStream that uses a QEMU fast-pipe
|
||||
* to communicate with the emulator's 'opengles' service. See
|
||||
* <hardware/qemu_pipe.h> for more details.
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include "IOStream.h"
|
||||
|
||||
class QemuPipeStream : public IOStream {
|
||||
public:
|
||||
typedef enum { ERR_INVALID_SOCKET = -1000 } QemuPipeStreamError;
|
||||
|
||||
explicit QemuPipeStream(size_t bufsize = 10000);
|
||||
~QemuPipeStream();
|
||||
int connect(void);
|
||||
|
||||
virtual void *allocBuffer(size_t minSize);
|
||||
virtual int commitBuffer(size_t size);
|
||||
virtual const unsigned char *readFully( void *buf, size_t len);
|
||||
virtual const unsigned char *read( void *buf, size_t *inout_len);
|
||||
|
||||
bool valid() { return m_sock >= 0; }
|
||||
int recv(void *buf, size_t len);
|
||||
|
||||
virtual int writeFully(const void *buf, size_t len);
|
||||
|
||||
private:
|
||||
int m_sock;
|
||||
size_t m_bufsize;
|
||||
unsigned char *m_buf;
|
||||
QemuPipeStream(int sock, size_t bufSize);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "ThreadInfo.h"
|
||||
#include "cutils/threads.h"
|
||||
|
||||
thread_store_t s_tls = THREAD_STORE_INITIALIZER;
|
||||
|
||||
static void tlsDestruct(void *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
EGLThreadInfo *ti = (EGLThreadInfo *)ptr;
|
||||
delete ti->hostConn;
|
||||
delete ti;
|
||||
}
|
||||
}
|
||||
|
||||
EGLThreadInfo *slow_getEGLThreadInfo()
|
||||
{
|
||||
EGLThreadInfo *ti = (EGLThreadInfo *)thread_store_get(&s_tls);
|
||||
if (ti) return ti;
|
||||
|
||||
ti = new EGLThreadInfo();
|
||||
thread_store_set(&s_tls, ti, tlsDestruct);
|
||||
|
||||
return ti;
|
||||
}
|
||||
59
tools/emulator/opengl/system/OpenglSystemCommon/ThreadInfo.h
Normal file
59
tools/emulator/opengl/system/OpenglSystemCommon/ThreadInfo.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _THREAD_INFO_H
|
||||
#define _THREAD_INFO_H
|
||||
|
||||
#include "HostConnection.h"
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
#include <bionic_tls.h>
|
||||
#endif
|
||||
|
||||
struct EGLContext_t;
|
||||
|
||||
struct EGLThreadInfo
|
||||
{
|
||||
EGLThreadInfo() : currentContext(NULL), hostConn(NULL), eglError(EGL_SUCCESS) {}
|
||||
|
||||
EGLContext_t *currentContext;
|
||||
HostConnection *hostConn;
|
||||
int eglError;
|
||||
};
|
||||
|
||||
|
||||
EGLThreadInfo *slow_getEGLThreadInfo();
|
||||
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
// We have a dedicated TLS slot in bionic
|
||||
inline EGLThreadInfo* getEGLThreadInfo() {
|
||||
EGLThreadInfo *tInfo =
|
||||
(EGLThreadInfo *)(((unsigned *)__get_tls())[TLS_SLOT_OPENGL]);
|
||||
if (!tInfo) {
|
||||
tInfo = slow_getEGLThreadInfo();
|
||||
((uint32_t *)__get_tls())[TLS_SLOT_OPENGL] = (uint32_t)tInfo;
|
||||
}
|
||||
return tInfo;
|
||||
}
|
||||
#else
|
||||
inline EGLThreadInfo* getEGLThreadInfo() {
|
||||
return slow_getEGLThreadInfo();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // of _THREAD_INFO_H
|
||||
106
tools/emulator/opengl/system/OpenglSystemCommon/gralloc_cb.h
Normal file
106
tools/emulator/opengl/system/OpenglSystemCommon/gralloc_cb.h
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __GRALLOC_CB_H__
|
||||
#define __GRALLOC_CB_H__
|
||||
|
||||
#include <hardware/hardware.h>
|
||||
#include <hardware/gralloc.h>
|
||||
#include <cutils/native_handle.h>
|
||||
|
||||
#define BUFFER_HANDLE_MAGIC ((int)0xabfabfab)
|
||||
#define CB_HANDLE_NUM_INTS(nfds) (int)((sizeof(cb_handle_t) - (nfds)*sizeof(int)) / sizeof(int))
|
||||
|
||||
//
|
||||
// Our buffer handle structure
|
||||
//
|
||||
struct cb_handle_t : public native_handle {
|
||||
|
||||
cb_handle_t(int p_fd, int p_ashmemSize, int p_usage,
|
||||
int p_width, int p_height,
|
||||
int p_glFormat, int p_glType) :
|
||||
fd(p_fd),
|
||||
magic(BUFFER_HANDLE_MAGIC),
|
||||
usage(p_usage),
|
||||
width(p_width),
|
||||
height(p_height),
|
||||
glFormat(p_glFormat),
|
||||
glType(p_glType),
|
||||
ashmemSize(p_ashmemSize),
|
||||
ashmemBase(NULL),
|
||||
ashmemBasePid(0),
|
||||
mappedPid(0),
|
||||
lockedLeft(0),
|
||||
lockedTop(0),
|
||||
lockedWidth(0),
|
||||
lockedHeight(0),
|
||||
hostHandle(0)
|
||||
{
|
||||
version = sizeof(native_handle);
|
||||
numFds = 0;
|
||||
numInts = CB_HANDLE_NUM_INTS(numFds);
|
||||
}
|
||||
|
||||
~cb_handle_t() {
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
void setFd(int p_fd) {
|
||||
if (p_fd >= 0) {
|
||||
numFds = 1;
|
||||
}
|
||||
else {
|
||||
numFds = 0;
|
||||
}
|
||||
fd = p_fd;
|
||||
numInts = CB_HANDLE_NUM_INTS(numFds);
|
||||
}
|
||||
|
||||
static bool validate(cb_handle_t * hnd) {
|
||||
return (hnd &&
|
||||
hnd->version == sizeof(native_handle) &&
|
||||
hnd->magic == BUFFER_HANDLE_MAGIC &&
|
||||
hnd->numInts == CB_HANDLE_NUM_INTS(hnd->numFds));
|
||||
}
|
||||
|
||||
bool canBePosted() {
|
||||
return (0 != (usage & GRALLOC_USAGE_HW_FB));
|
||||
}
|
||||
|
||||
// file-descriptors
|
||||
int fd; // ashmem fd (-1 of ashmem region did not allocated, i.e. no SW access needed)
|
||||
|
||||
// ints
|
||||
int magic; // magic number in order to validate a pointer to be a cb_handle_t
|
||||
int usage; // usage bits the buffer was created with
|
||||
int width; // buffer width
|
||||
int height; // buffer height
|
||||
int glFormat; // OpenGL format enum used for host h/w color buffer
|
||||
int glType; // OpenGL type enum used when uploading to host
|
||||
int ashmemSize; // ashmem region size for the buffer (0 unless is HW_FB buffer or
|
||||
// s/w access is needed)
|
||||
int ashmemBase; // CPU address of the mapped ashmem region
|
||||
int ashmemBasePid; // process id which mapped the ashmem region
|
||||
int mappedPid; // process id which succeeded gralloc_register call
|
||||
int lockedLeft; // region of buffer locked for s/w write
|
||||
int lockedTop;
|
||||
int lockedWidth;
|
||||
int lockedHeight;
|
||||
uint32_t hostHandle;
|
||||
};
|
||||
|
||||
|
||||
#endif //__GRALLOC_CB_H__
|
||||
42
tools/emulator/opengl/system/egl/Android.mk
Normal file
42
tools/emulator/opengl/system/egl/Android.mk
Normal file
@@ -0,0 +1,42 @@
|
||||
ifneq (false,$(BUILD_EMULATOR_OPENGL_DRIVER))
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
$(call emugl-begin-shared-library,libEGL_emulation)
|
||||
$(call emugl-import,libOpenglSystemCommon)
|
||||
$(call emugl-set-shared-library-subpath,egl)
|
||||
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"EGL_emulation\" -DEGL_EGLEXT_PROTOTYPES -DWITH_GLES2
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
eglDisplay.cpp \
|
||||
egl.cpp \
|
||||
ClientAPIExts.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES += libdl
|
||||
|
||||
# Used to access the Bionic private OpenGL TLS slot
|
||||
LOCAL_C_INCLUDES += bionic/libc/private
|
||||
|
||||
$(call emugl-end-module)
|
||||
|
||||
#### egl.cfg ####
|
||||
|
||||
# Ensure that this file is only copied to emulator-specific builds.
|
||||
# Other builds are device-specific and will provide their own
|
||||
# version of this file to point to the appropriate HW EGL libraries.
|
||||
#
|
||||
ifneq (,$(filter full full_x86 full_mips sdk sdk_x86 sdk_mips google_sdk google_sdk_x86 google_sdk_mips,$(TARGET_PRODUCT)))
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := egl.cfg
|
||||
LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
||||
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/egl
|
||||
LOCAL_MODULE_TAGS := debug
|
||||
LOCAL_MODULE_CLASS := ETC
|
||||
|
||||
include $(BUILD_PREBUILT)
|
||||
endif # TARGET_PRODUCT in 'full full_x86 full_mips sdk sdk_x86 sdk_mips google_sdk google_sdk_x86 google_sdk_mips')
|
||||
|
||||
endif # BUILD_EMULATOR_OPENGL_DRIVER != false
|
||||
157
tools/emulator/opengl/system/egl/ClientAPIExts.cpp
Normal file
157
tools/emulator/opengl/system/egl/ClientAPIExts.cpp
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "ClientAPIExts.h"
|
||||
#include "ThreadInfo.h"
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#include "eglContext.h"
|
||||
|
||||
namespace ClientAPIExts
|
||||
{
|
||||
|
||||
//
|
||||
// define function pointer type for each extention function
|
||||
// typename has the form __egl_{funcname}_t
|
||||
//
|
||||
#define FUNC_TYPE(fname) __egl_ ## fname ## _t
|
||||
#define API_ENTRY(fname,params,args) \
|
||||
typedef void (GL_APIENTRY *FUNC_TYPE(fname)) params;
|
||||
|
||||
#define API_ENTRY_RET(rtype,fname,params,args) \
|
||||
typedef rtype (GL_APIENTRY *FUNC_TYPE(fname)) params;
|
||||
|
||||
#include "ClientAPIExts.in"
|
||||
#undef API_ENTRY
|
||||
#undef API_ENTRY_RET
|
||||
|
||||
/////
|
||||
// Define static table to store the function value for each
|
||||
// client API. functions pointers will get initialized through
|
||||
// ClientAPIExts::initClientFuncs function after each client API has been
|
||||
// loaded.
|
||||
/////
|
||||
#define API_ENTRY(fname,params,args) \
|
||||
FUNC_TYPE(fname) fname;
|
||||
|
||||
#define API_ENTRY_RET(rtype,fname,params,args) \
|
||||
API_ENTRY(fname,params,args)
|
||||
|
||||
static struct _ext_table
|
||||
{
|
||||
#include "ClientAPIExts.in"
|
||||
} s_client_extensions[2];
|
||||
|
||||
#undef API_ENTRY
|
||||
#undef API_ENTRY_RET
|
||||
|
||||
//
|
||||
// This function initialized each entry in the s_client_extensions
|
||||
// struct at the givven index using the givven client interface
|
||||
//
|
||||
void initClientFuncs(const EGLClient_glesInterface *iface, int idx)
|
||||
{
|
||||
#define API_ENTRY(fname,params,args) \
|
||||
s_client_extensions[idx].fname = \
|
||||
(FUNC_TYPE(fname))iface->getProcAddress(#fname);
|
||||
|
||||
#define API_ENTRY_RET(rtype,fname,params,args) \
|
||||
API_ENTRY(fname,params,args)
|
||||
|
||||
//
|
||||
// reset all func pointers to NULL
|
||||
//
|
||||
memset(&s_client_extensions[idx], 0, sizeof(struct _ext_table));
|
||||
|
||||
//
|
||||
// And now query the GLES library for each proc address
|
||||
//
|
||||
#include "ClientAPIExts.in"
|
||||
#undef API_ENTRY
|
||||
#undef API_ENTRY_RET
|
||||
}
|
||||
|
||||
//
|
||||
// Define implementation for each extension function which checks
|
||||
// the current context version and calls to the correct client API
|
||||
// function.
|
||||
//
|
||||
#define API_ENTRY(fname,params,args) \
|
||||
static void _egl_ ## fname params \
|
||||
{ \
|
||||
EGLThreadInfo* thread = getEGLThreadInfo(); \
|
||||
if (!thread->currentContext) { \
|
||||
return; \
|
||||
} \
|
||||
int idx = (int)thread->currentContext->version - 1; \
|
||||
if (!s_client_extensions[idx].fname) { \
|
||||
return; \
|
||||
} \
|
||||
(*s_client_extensions[idx].fname) args; \
|
||||
}
|
||||
|
||||
#define API_ENTRY_RET(rtype,fname,params,args) \
|
||||
static rtype _egl_ ## fname params \
|
||||
{ \
|
||||
EGLThreadInfo* thread = getEGLThreadInfo(); \
|
||||
if (!thread->currentContext) { \
|
||||
return (rtype)0; \
|
||||
} \
|
||||
int idx = (int)thread->currentContext->version - 1; \
|
||||
if (!s_client_extensions[idx].fname) { \
|
||||
return (rtype)0; \
|
||||
} \
|
||||
return (*s_client_extensions[idx].fname) args; \
|
||||
}
|
||||
|
||||
#include "ClientAPIExts.in"
|
||||
#undef API_ENTRY
|
||||
#undef API_ENTRY_RET
|
||||
|
||||
//
|
||||
// Define a table to map function names to the local _egl_ version of
|
||||
// the extension function, to be used in eglGetProcAddress.
|
||||
//
|
||||
#define API_ENTRY(fname,params,args) \
|
||||
{ #fname, (void*)_egl_ ## fname},
|
||||
#define API_ENTRY_RET(rtype,fname,params,args) \
|
||||
API_ENTRY(fname,params,args)
|
||||
|
||||
static const struct _client_ext_funcs {
|
||||
const char *fname;
|
||||
void* proc;
|
||||
} s_client_ext_funcs[] = {
|
||||
#include "ClientAPIExts.in"
|
||||
};
|
||||
static const int numExtFuncs = sizeof(s_client_ext_funcs) /
|
||||
sizeof(s_client_ext_funcs[0]);
|
||||
|
||||
#undef API_ENTRY
|
||||
#undef API_ENTRY_RET
|
||||
|
||||
//
|
||||
// returns the __egl_ version of the givven extension function name.
|
||||
//
|
||||
void* getProcAddress(const char *fname)
|
||||
{
|
||||
for (int i=0; i<numExtFuncs; i++) {
|
||||
if (!strcmp(fname, s_client_ext_funcs[i].fname)) {
|
||||
return s_client_ext_funcs[i].proc;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
} // of namespace ClientAPIExts
|
||||
29
tools/emulator/opengl/system/egl/ClientAPIExts.h
Normal file
29
tools/emulator/opengl/system/egl/ClientAPIExts.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _CLIENT_APIS_EXTS_H
|
||||
#define _CLIENT_APIS_EXTS_H
|
||||
|
||||
#include "EGLClientIface.h"
|
||||
|
||||
namespace ClientAPIExts
|
||||
{
|
||||
|
||||
void initClientFuncs(const EGLClient_glesInterface *iface, int idx);
|
||||
void* getProcAddress(const char *fname);
|
||||
|
||||
} // of namespace ClientAPIExts
|
||||
|
||||
#endif
|
||||
201
tools/emulator/opengl/system/egl/ClientAPIExts.in
Normal file
201
tools/emulator/opengl/system/egl/ClientAPIExts.in
Normal file
@@ -0,0 +1,201 @@
|
||||
//
|
||||
// Each extension function should have one of the following
|
||||
// macro definitions:
|
||||
// API_ENTRY(funcname, paramlist, arglist)
|
||||
// -or- (if the function has a return value)
|
||||
// API_ENTRY_RET(return_type,funcname, paramlist, arglist)
|
||||
//
|
||||
API_ENTRY(glEGLImageTargetTexture2DOES,
|
||||
(GLenum target, GLeglImageOES image),
|
||||
(target, image))
|
||||
|
||||
API_ENTRY(glEGLImageTargetRenderbufferStorageOES,
|
||||
(GLenum target, GLeglImageOES image),
|
||||
(target, image))
|
||||
|
||||
API_ENTRY(glBlendEquationSeparateOES,
|
||||
(GLenum modeRGB, GLenum modeAlpha),
|
||||
(modeRGB, modeAlpha))
|
||||
|
||||
API_ENTRY(glBlendFuncSeparateOES,
|
||||
(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha),
|
||||
(srcRGB, dstRGB, srcAlpha, dstAlpha))
|
||||
|
||||
API_ENTRY(glBlendEquationOES,
|
||||
(GLenum mode),
|
||||
(mode))
|
||||
|
||||
API_ENTRY(glCurrentPaletteMatrixOES,
|
||||
(GLuint matrixpaletteindex),
|
||||
(matrixpaletteindex))
|
||||
|
||||
API_ENTRY(glLoadPaletteFromModelViewMatrixOES,
|
||||
(void),
|
||||
())
|
||||
|
||||
API_ENTRY(glMatrixIndexPointerOES,
|
||||
(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer),
|
||||
(size, type, stride, pointer))
|
||||
|
||||
API_ENTRY(glWeightPointerOES,
|
||||
(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer),
|
||||
(size, type, stride, pointer))
|
||||
|
||||
API_ENTRY(glDepthRangefOES,
|
||||
(GLclampf zNear, GLclampf zFar),
|
||||
(zNear, zFar))
|
||||
|
||||
API_ENTRY(glFrustumfOES,
|
||||
(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar),
|
||||
(left, right, bottom, top, zNear, zFar))
|
||||
|
||||
API_ENTRY(glOrthofOES,
|
||||
(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar),
|
||||
(left, right, bottom, top, zNear, zFar))
|
||||
|
||||
API_ENTRY(glClipPlanefOES,
|
||||
(GLenum plane, const GLfloat *equation),
|
||||
(plane, equation))
|
||||
|
||||
API_ENTRY(glGetClipPlanefOES,
|
||||
(GLenum pname, GLfloat * eqn),
|
||||
(pname, eqn))
|
||||
|
||||
API_ENTRY(glClearDepthfOES,
|
||||
(GLclampf depth),
|
||||
(depth))
|
||||
|
||||
API_ENTRY(glPointSizePointerOES,
|
||||
(GLenum type, GLsizei stride, const GLvoid *pointer),
|
||||
(type, stride, pointer))
|
||||
|
||||
API_ENTRY(glTexGenfOES,
|
||||
(GLenum coord, GLenum pname, GLfloat param),
|
||||
(coord, pname, param))
|
||||
|
||||
API_ENTRY(glTexGenfvOES,
|
||||
(GLenum coord, GLenum pname, const GLfloat *params),
|
||||
(coord, pname, params))
|
||||
|
||||
API_ENTRY(glTexGeniOES,
|
||||
(GLenum coord, GLenum pname, GLint param),
|
||||
(coord, pname, param))
|
||||
|
||||
API_ENTRY(glTexGenivOES,
|
||||
(GLenum coord, GLenum pname, const GLint *params),
|
||||
(coord, pname, params))
|
||||
|
||||
API_ENTRY(glTexGenxOES,
|
||||
(GLenum coord, GLenum pname, GLfixed param),
|
||||
(coord, pname, param))
|
||||
|
||||
API_ENTRY(glTexGenxvOES,
|
||||
(GLenum coord, GLenum pname, const GLfixed *params),
|
||||
(coord, pname, params))
|
||||
|
||||
API_ENTRY(glGetTexGenfvOES,
|
||||
(GLenum coord, GLenum pname, GLfloat *params),
|
||||
(coord, pname, params))
|
||||
|
||||
API_ENTRY(glGetTexGenivOES,
|
||||
(GLenum coord, GLenum pname, GLint *params),
|
||||
(coord, pname, params))
|
||||
|
||||
API_ENTRY(glGetTexGenxvOES,
|
||||
(GLenum coord, GLenum pname, GLfixed *params),
|
||||
(coord, pname, params))
|
||||
|
||||
API_ENTRY_RET(GLboolean,
|
||||
glIsRenderbufferOES,
|
||||
(GLuint renderbuffer),
|
||||
(renderbuffer))
|
||||
|
||||
API_ENTRY(glBindRenderbufferOES,
|
||||
(GLenum target, GLuint renderbuffer),
|
||||
(target, renderbuffer))
|
||||
|
||||
API_ENTRY(glDeleteRenderbuffersOES,
|
||||
(GLsizei n, const GLuint* renderbuffers),
|
||||
(n, renderbuffers))
|
||||
|
||||
API_ENTRY(glGenRenderbuffersOES,
|
||||
(GLsizei n, GLuint* renderbuffers),
|
||||
(n, renderbuffers))
|
||||
|
||||
API_ENTRY(glRenderbufferStorageOES,
|
||||
(GLenum target, GLenum internalformat, GLsizei width, GLsizei height),
|
||||
(target, internalformat, width, height))
|
||||
|
||||
API_ENTRY(glGetRenderbufferParameterivOES,
|
||||
(GLenum target, GLenum pname, GLint* params),
|
||||
(target, pname, params))
|
||||
|
||||
API_ENTRY_RET(GLboolean,
|
||||
glIsFramebufferOES,
|
||||
(GLuint framebuffer),
|
||||
(framebuffer))
|
||||
|
||||
API_ENTRY(glBindFramebufferOES,
|
||||
(GLenum target, GLuint framebuffer),
|
||||
(target, framebuffer))
|
||||
|
||||
API_ENTRY(glDeleteFramebuffersOES,
|
||||
(GLsizei n, const GLuint* framebuffers),
|
||||
(n, framebuffers))
|
||||
|
||||
API_ENTRY(glGenFramebuffersOES,
|
||||
(GLsizei n, GLuint* framebuffers),
|
||||
(n, framebuffers))
|
||||
|
||||
API_ENTRY_RET(GLenum,
|
||||
glCheckFramebufferStatusOES,
|
||||
(GLenum target),
|
||||
(target))
|
||||
|
||||
API_ENTRY(glFramebufferTexture2DOES,
|
||||
(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level),
|
||||
(target, attachment, textarget, texture, level))
|
||||
|
||||
API_ENTRY(glFramebufferRenderbufferOES,
|
||||
(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer),
|
||||
(target, attachment, renderbuffertarget, renderbuffer))
|
||||
|
||||
API_ENTRY(glGetFramebufferAttachmentParameterivOES,
|
||||
(GLenum target, GLenum attachment, GLenum pname, GLint* params),
|
||||
(target, attachment, pname, params))
|
||||
|
||||
API_ENTRY(glGenerateMipmapOES,
|
||||
(GLenum target),
|
||||
(target))
|
||||
|
||||
API_ENTRY(glDrawTexsOES,
|
||||
(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height),
|
||||
(x, y, z, width, height))
|
||||
|
||||
API_ENTRY(glDrawTexiOES,
|
||||
(GLint x, GLint y, GLint z, GLint width, GLint height),
|
||||
(x, y, z, width, height))
|
||||
|
||||
API_ENTRY(glDrawTexfOES,
|
||||
(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height),
|
||||
(x, y, z, width, height))
|
||||
|
||||
API_ENTRY(glDrawTexxOES,
|
||||
(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height),
|
||||
(x, y, z, width, height))
|
||||
|
||||
API_ENTRY(glDrawTexsvOES,
|
||||
(const GLshort *coords),
|
||||
(coords))
|
||||
|
||||
API_ENTRY(glDrawTexivOES,
|
||||
(const GLint *coords),
|
||||
(coords))
|
||||
|
||||
API_ENTRY(glDrawTexfvOES,
|
||||
(const GLfloat *coords),
|
||||
(coords))
|
||||
|
||||
API_ENTRY(glDrawTexxvOES,
|
||||
(const GLfixed *coords),
|
||||
(coords))
|
||||
1
tools/emulator/opengl/system/egl/egl.cfg
Normal file
1
tools/emulator/opengl/system/egl/egl.cfg
Normal file
@@ -0,0 +1 @@
|
||||
0 0 emulation
|
||||
1254
tools/emulator/opengl/system/egl/egl.cpp
Normal file
1254
tools/emulator/opengl/system/egl/egl.cpp
Normal file
File diff suppressed because it is too large
Load Diff
51
tools/emulator/opengl/system/egl/eglContext.h
Normal file
51
tools/emulator/opengl/system/egl/eglContext.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _EGL_CONTEXT_H
|
||||
#define _EGL_CONTEXT_H
|
||||
|
||||
#include "GLClientState.h"
|
||||
#include "GLSharedGroup.h"
|
||||
|
||||
struct EGLContext_t {
|
||||
|
||||
enum {
|
||||
IS_CURRENT = 0x00010000,
|
||||
NEVER_CURRENT = 0x00020000
|
||||
};
|
||||
|
||||
EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx);
|
||||
~EGLContext_t();
|
||||
uint32_t flags;
|
||||
EGLDisplay dpy;
|
||||
EGLConfig config;
|
||||
EGLSurface read;
|
||||
EGLSurface draw;
|
||||
EGLContext_t * shareCtx;
|
||||
EGLint version;
|
||||
uint32_t rcContext;
|
||||
const char* versionString;
|
||||
const char* vendorString;
|
||||
const char* rendererString;
|
||||
const char* extensionString;
|
||||
|
||||
GLClientState * getClientState(){ return clientState; }
|
||||
GLSharedGroupPtr getSharedGroup(){ return sharedGroup; }
|
||||
private:
|
||||
GLClientState * clientState;
|
||||
GLSharedGroupPtr sharedGroup;
|
||||
};
|
||||
|
||||
#endif
|
||||
497
tools/emulator/opengl/system/egl/eglDisplay.cpp
Normal file
497
tools/emulator/opengl/system/egl/eglDisplay.cpp
Normal file
@@ -0,0 +1,497 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "eglDisplay.h"
|
||||
#include "HostConnection.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
static const int systemEGLVersionMajor = 1;
|
||||
static const int systemEGLVersionMinor = 4;
|
||||
static const char systemEGLVendor[] = "Google Android emulator";
|
||||
|
||||
// list of extensions supported by this EGL implementation
|
||||
// NOTE that each extension name should be suffixed with space
|
||||
static const char systemStaticEGLExtensions[] =
|
||||
"EGL_ANDROID_image_native_buffer "
|
||||
"EGL_KHR_fence_sync ";
|
||||
|
||||
// list of extensions supported by this EGL implementation only if supported
|
||||
// on the host implementation.
|
||||
// NOTE that each extension name should be suffixed with space
|
||||
static const char systemDynamicEGLExtensions[] =
|
||||
"EGL_KHR_image_base "
|
||||
"EGL_KHR_gl_texture_2d_image ";
|
||||
|
||||
|
||||
static void *s_gles_lib = NULL;
|
||||
static void *s_gles2_lib = NULL;
|
||||
|
||||
// The following function will be called when we (libEGL)
|
||||
// gets unloaded
|
||||
// At this point we want to unload the gles libraries we
|
||||
// might have loaded during initialization
|
||||
static void __attribute__ ((destructor)) do_on_unload(void)
|
||||
{
|
||||
if (s_gles_lib) {
|
||||
dlclose(s_gles_lib);
|
||||
}
|
||||
|
||||
if (s_gles2_lib) {
|
||||
dlclose(s_gles2_lib);
|
||||
}
|
||||
}
|
||||
|
||||
eglDisplay::eglDisplay() :
|
||||
m_initialized(false),
|
||||
m_major(0),
|
||||
m_minor(0),
|
||||
m_hostRendererVersion(0),
|
||||
m_numConfigs(0),
|
||||
m_numConfigAttribs(0),
|
||||
m_attribs(DefaultKeyedVector<EGLint, EGLint>(ATTRIBUTE_NONE)),
|
||||
m_configs(NULL),
|
||||
m_gles_iface(NULL),
|
||||
m_gles2_iface(NULL),
|
||||
m_versionString(NULL),
|
||||
m_vendorString(NULL),
|
||||
m_extensionString(NULL)
|
||||
{
|
||||
pthread_mutex_init(&m_lock, NULL);
|
||||
}
|
||||
|
||||
eglDisplay::~eglDisplay()
|
||||
{
|
||||
pthread_mutex_destroy(&m_lock);
|
||||
}
|
||||
|
||||
bool eglDisplay::initialize(EGLClient_eglInterface *eglIface)
|
||||
{
|
||||
pthread_mutex_lock(&m_lock);
|
||||
if (!m_initialized) {
|
||||
|
||||
//
|
||||
// load GLES client API
|
||||
//
|
||||
m_gles_iface = loadGLESClientAPI("/system/lib/egl/libGLESv1_CM_emulation.so",
|
||||
eglIface,
|
||||
&s_gles_lib);
|
||||
if (!m_gles_iface) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
ALOGE("Failed to load gles1 iface");
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef WITH_GLES2
|
||||
m_gles2_iface = loadGLESClientAPI("/system/lib/egl/libGLESv2_emulation.so",
|
||||
eglIface,
|
||||
&s_gles2_lib);
|
||||
// Note that if loading gles2 failed, we can still run with no
|
||||
// GLES2 support, having GLES2 is not mandatory.
|
||||
#endif
|
||||
|
||||
//
|
||||
// establish connection with the host
|
||||
//
|
||||
HostConnection *hcon = HostConnection::get();
|
||||
if (!hcon) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
ALOGE("Failed to establish connection with the host\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// get renderControl encoder instance
|
||||
//
|
||||
renderControl_encoder_context_t *rcEnc = hcon->rcEncoder();
|
||||
if (!rcEnc) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
ALOGE("Failed to get renderControl encoder instance");
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Query host reneder and EGL version
|
||||
//
|
||||
m_hostRendererVersion = rcEnc->rcGetRendererVersion(rcEnc);
|
||||
EGLint status = rcEnc->rcGetEGLVersion(rcEnc, &m_major, &m_minor);
|
||||
if (status != EGL_TRUE) {
|
||||
// host EGL initialization failed !!
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Take minimum version beween what we support and what the host support
|
||||
//
|
||||
if (m_major > systemEGLVersionMajor) {
|
||||
m_major = systemEGLVersionMajor;
|
||||
m_minor = systemEGLVersionMinor;
|
||||
}
|
||||
else if (m_major == systemEGLVersionMajor &&
|
||||
m_minor > systemEGLVersionMinor) {
|
||||
m_minor = systemEGLVersionMinor;
|
||||
}
|
||||
|
||||
//
|
||||
// Query the host for the set of configs
|
||||
//
|
||||
m_numConfigs = rcEnc->rcGetNumConfigs(rcEnc, (uint32_t*)&m_numConfigAttribs);
|
||||
if (m_numConfigs <= 0 || m_numConfigAttribs <= 0) {
|
||||
// just sanity check - should never happen
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t nInts = m_numConfigAttribs * (m_numConfigs + 1);
|
||||
EGLint tmp_buf[nInts];
|
||||
m_configs = new EGLint[nInts-m_numConfigAttribs];
|
||||
if (!m_configs) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
//EGLint n = rcEnc->rcGetConfigs(rcEnc, nInts*sizeof(EGLint), m_configs);
|
||||
EGLint n = rcEnc->rcGetConfigs(rcEnc, nInts*sizeof(EGLint), (GLuint*)tmp_buf);
|
||||
if (n != m_numConfigs) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
//Fill the attributes vector.
|
||||
//The first m_numConfigAttribs values of tmp_buf are the actual attributes enums.
|
||||
for (int i=0; i<m_numConfigAttribs; i++) {
|
||||
m_attribs.add(tmp_buf[i], i);
|
||||
}
|
||||
|
||||
//Copy the actual configs data to m_configs
|
||||
memcpy(m_configs, tmp_buf + m_numConfigAttribs, m_numConfigs*m_numConfigAttribs*sizeof(EGLint));
|
||||
|
||||
m_initialized = true;
|
||||
}
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
|
||||
processConfigs();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void eglDisplay::processConfigs()
|
||||
{
|
||||
for (int i=0; i<m_numConfigs; i++) {
|
||||
EGLConfig config = (EGLConfig)i;
|
||||
//Setup the EGL_NATIVE_VISUAL_ID attribute
|
||||
PixelFormat format;
|
||||
if (getConfigNativePixelFormat(config, &format)) {
|
||||
setConfigAttrib(config, EGL_NATIVE_VISUAL_ID, format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void eglDisplay::terminate()
|
||||
{
|
||||
pthread_mutex_lock(&m_lock);
|
||||
if (m_initialized) {
|
||||
m_initialized = false;
|
||||
delete [] m_configs;
|
||||
m_configs = NULL;
|
||||
|
||||
if (m_versionString) {
|
||||
free(m_versionString);
|
||||
m_versionString = NULL;
|
||||
}
|
||||
if (m_vendorString) {
|
||||
free(m_vendorString);
|
||||
m_vendorString = NULL;
|
||||
}
|
||||
if (m_extensionString) {
|
||||
free(m_extensionString);
|
||||
m_extensionString = NULL;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
}
|
||||
|
||||
EGLClient_glesInterface *eglDisplay::loadGLESClientAPI(const char *libName,
|
||||
EGLClient_eglInterface *eglIface,
|
||||
void **libHandle)
|
||||
{
|
||||
void *lib = dlopen(libName, RTLD_NOW);
|
||||
if (!lib) {
|
||||
ALOGE("Failed to dlopen %s", libName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
init_emul_gles_t init_gles_func = (init_emul_gles_t)dlsym(lib,"init_emul_gles");
|
||||
if (!init_gles_func) {
|
||||
ALOGE("Failed to find init_emul_gles");
|
||||
dlclose((void*)lib);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*libHandle = lib;
|
||||
return (*init_gles_func)(eglIface);
|
||||
}
|
||||
|
||||
static char *queryHostEGLString(EGLint name)
|
||||
{
|
||||
HostConnection *hcon = HostConnection::get();
|
||||
if (hcon) {
|
||||
renderControl_encoder_context_t *rcEnc = hcon->rcEncoder();
|
||||
if (rcEnc) {
|
||||
int n = rcEnc->rcQueryEGLString(rcEnc, name, NULL, 0);
|
||||
if (n < 0) {
|
||||
// allocate space for the string with additional
|
||||
// space charachter to be suffixed at the end.
|
||||
char *str = (char *)malloc(-n+2);
|
||||
n = rcEnc->rcQueryEGLString(rcEnc, name, str, -n);
|
||||
if (n > 0) {
|
||||
// add extra space at end of string which will be
|
||||
// needed later when filtering the extension list.
|
||||
strcat(str, " ");
|
||||
return str;
|
||||
}
|
||||
|
||||
free(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool findExtInList(const char* token, int tokenlen, const char* list)
|
||||
{
|
||||
const char* p = list;
|
||||
while (*p != '\0') {
|
||||
const char* q = strchr(p, ' ');
|
||||
if (q == NULL) {
|
||||
/* should not happen, list must be space-terminated */
|
||||
break;
|
||||
}
|
||||
if (tokenlen == (q - p) && !memcmp(token, p, tokenlen)) {
|
||||
return true; /* found it */
|
||||
}
|
||||
p = q+1;
|
||||
}
|
||||
return false; /* not found */
|
||||
}
|
||||
|
||||
static char *buildExtensionString()
|
||||
{
|
||||
//Query host extension string
|
||||
char *hostExt = queryHostEGLString(EGL_EXTENSIONS);
|
||||
if (!hostExt || (hostExt[1] == '\0')) {
|
||||
// no extensions on host - only static extension list supported
|
||||
return strdup(systemStaticEGLExtensions);
|
||||
}
|
||||
|
||||
//
|
||||
// Filter host extension list to include only extensions
|
||||
// we can support (in the systemDynamicEGLExtensions list)
|
||||
//
|
||||
char *ext = (char *)hostExt;
|
||||
char *c = ext;
|
||||
char *insert = ext;
|
||||
while(*c != '\0') {
|
||||
if (*c == ' ') {
|
||||
int len = c - ext;
|
||||
if (findExtInList(ext, len, systemDynamicEGLExtensions)) {
|
||||
if (ext != insert) {
|
||||
memcpy(insert, ext, len+1); // including space
|
||||
}
|
||||
insert += (len + 1);
|
||||
}
|
||||
ext = c + 1;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
*insert = '\0';
|
||||
|
||||
int n = strlen(hostExt);
|
||||
if (n > 0) {
|
||||
char *str;
|
||||
asprintf(&str,"%s%s", systemStaticEGLExtensions, hostExt);
|
||||
free((char*)hostExt);
|
||||
return str;
|
||||
}
|
||||
else {
|
||||
free((char*)hostExt);
|
||||
return strdup(systemStaticEGLExtensions);
|
||||
}
|
||||
}
|
||||
|
||||
const char *eglDisplay::queryString(EGLint name)
|
||||
{
|
||||
if (name == EGL_CLIENT_APIS) {
|
||||
return "OpenGL_ES";
|
||||
}
|
||||
else if (name == EGL_VERSION) {
|
||||
pthread_mutex_lock(&m_lock);
|
||||
if (m_versionString) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return m_versionString;
|
||||
}
|
||||
|
||||
// build version string
|
||||
asprintf(&m_versionString, "%d.%d", m_major, m_minor);
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
|
||||
return m_versionString;
|
||||
}
|
||||
else if (name == EGL_VENDOR) {
|
||||
pthread_mutex_lock(&m_lock);
|
||||
if (m_vendorString) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return m_vendorString;
|
||||
}
|
||||
|
||||
// build vendor string
|
||||
const char *hostVendor = queryHostEGLString(EGL_VENDOR);
|
||||
|
||||
if (hostVendor) {
|
||||
asprintf(&m_vendorString, "%s Host: %s",
|
||||
systemEGLVendor, hostVendor);
|
||||
free((char*)hostVendor);
|
||||
}
|
||||
else {
|
||||
m_vendorString = (char *)systemEGLVendor;
|
||||
}
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
|
||||
return m_vendorString;
|
||||
}
|
||||
else if (name == EGL_EXTENSIONS) {
|
||||
pthread_mutex_lock(&m_lock);
|
||||
if (m_extensionString) {
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return m_extensionString;
|
||||
}
|
||||
|
||||
// build extension string
|
||||
m_extensionString = buildExtensionString();
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
|
||||
return m_extensionString;
|
||||
}
|
||||
else {
|
||||
ALOGE("[%s] Unknown name %d\n", __FUNCTION__, name);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* To get the value of attribute <a> of config <c> use the following formula:
|
||||
* value = *(m_configs + (int)c*m_numConfigAttribs + a);
|
||||
*/
|
||||
EGLBoolean eglDisplay::getAttribValue(EGLConfig config, EGLint attribIdx, EGLint * value)
|
||||
{
|
||||
if (attribIdx == ATTRIBUTE_NONE)
|
||||
{
|
||||
ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
*value = *(m_configs + (int)config*m_numConfigAttribs + attribIdx);
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
EGLBoolean eglDisplay::getConfigAttrib(EGLConfig config, EGLint attrib, EGLint * value)
|
||||
{
|
||||
//Though it seems that valueFor() is thread-safe, we don't take chanses
|
||||
pthread_mutex_lock(&m_lock);
|
||||
EGLBoolean ret = getAttribValue(config, m_attribs.valueFor(attrib), value);
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void eglDisplay::dumpConfig(EGLConfig config)
|
||||
{
|
||||
EGLint value = 0;
|
||||
DBG("^^^^^^^^^^ dumpConfig %d ^^^^^^^^^^^^^^^^^^", (int)config);
|
||||
for (int i=0; i<m_numConfigAttribs; i++) {
|
||||
getAttribValue(config, i, &value);
|
||||
DBG("{%d}[%d] %d\n", (int)config, i, value);
|
||||
}
|
||||
}
|
||||
|
||||
/* To set the value of attribute <a> of config <c> use the following formula:
|
||||
* *(m_configs + (int)c*m_numConfigAttribs + a) = value;
|
||||
*/
|
||||
EGLBoolean eglDisplay::setAttribValue(EGLConfig config, EGLint attribIdx, EGLint value)
|
||||
{
|
||||
if (attribIdx == ATTRIBUTE_NONE)
|
||||
{
|
||||
ALOGE("[%s] Bad attribute idx\n", __FUNCTION__);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
*(m_configs + (int)config*m_numConfigAttribs + attribIdx) = value;
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
EGLBoolean eglDisplay::setConfigAttrib(EGLConfig config, EGLint attrib, EGLint value)
|
||||
{
|
||||
//Though it seems that valueFor() is thread-safe, we don't take chanses
|
||||
pthread_mutex_lock(&m_lock);
|
||||
EGLBoolean ret = setAttribValue(config, m_attribs.valueFor(attrib), value);
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean eglDisplay::getConfigNativePixelFormat(EGLConfig config, PixelFormat * format)
|
||||
{
|
||||
EGLint redSize, blueSize, greenSize, alphaSize;
|
||||
|
||||
if ( !(getAttribValue(config, m_attribs.valueFor(EGL_RED_SIZE), &redSize) &&
|
||||
getAttribValue(config, m_attribs.valueFor(EGL_BLUE_SIZE), &blueSize) &&
|
||||
getAttribValue(config, m_attribs.valueFor(EGL_GREEN_SIZE), &greenSize) &&
|
||||
getAttribValue(config, m_attribs.valueFor(EGL_ALPHA_SIZE), &alphaSize)) )
|
||||
{
|
||||
ALOGE("Couldn't find value for one of the pixel format attributes");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
//calculate the GL internal format
|
||||
if ((redSize==8)&&(greenSize==8)&&(blueSize==8)&&(alphaSize==8)) *format = PIXEL_FORMAT_RGBA_8888; //XXX: BGR?
|
||||
else if ((redSize==8)&&(greenSize==8)&&(blueSize==8)&&(alphaSize==0)) *format = PIXEL_FORMAT_RGBX_8888; //XXX or PIXEL_FORMAT_RGB_888
|
||||
else if ((redSize==5)&&(greenSize==6)&&(blueSize==5)&&(alphaSize==0)) *format = PIXEL_FORMAT_RGB_565;
|
||||
else if ((redSize==5)&&(greenSize==5)&&(blueSize==5)&&(alphaSize==1)) *format = PIXEL_FORMAT_RGBA_5551;
|
||||
else if ((redSize==4)&&(greenSize==4)&&(blueSize==4)&&(alphaSize==4)) *format = PIXEL_FORMAT_RGBA_4444;
|
||||
else {
|
||||
return EGL_FALSE;
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
EGLBoolean eglDisplay::getConfigGLPixelFormat(EGLConfig config, GLenum * format)
|
||||
{
|
||||
EGLint redSize, blueSize, greenSize, alphaSize;
|
||||
|
||||
if ( !(getAttribValue(config, m_attribs.valueFor(EGL_RED_SIZE), &redSize) &&
|
||||
getAttribValue(config, m_attribs.valueFor(EGL_BLUE_SIZE), &blueSize) &&
|
||||
getAttribValue(config, m_attribs.valueFor(EGL_GREEN_SIZE), &greenSize) &&
|
||||
getAttribValue(config, m_attribs.valueFor(EGL_ALPHA_SIZE), &alphaSize)) )
|
||||
{
|
||||
ALOGE("Couldn't find value for one of the pixel format attributes");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
//calculate the GL internal format
|
||||
if ((redSize==8)&&(blueSize==8)&&(blueSize==8)&&(alphaSize==8)) *format = GL_RGBA;
|
||||
else if ((redSize==8)&&(greenSize==8)&&(blueSize==8)&&(alphaSize==0)) *format = GL_RGB;
|
||||
else if ((redSize==5)&&(greenSize==6)&&(blueSize==5)&&(alphaSize==0)) *format = GL_RGB565_OES;
|
||||
else if ((redSize==5)&&(greenSize==5)&&(blueSize==5)&&(alphaSize==1)) *format = GL_RGB5_A1_OES;
|
||||
else if ((redSize==4)&&(greenSize==4)&&(blueSize==4)&&(alphaSize==4)) *format = GL_RGBA4_OES;
|
||||
else return EGL_FALSE;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
89
tools/emulator/opengl/system/egl/eglDisplay.h
Normal file
89
tools/emulator/opengl/system/egl/eglDisplay.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _SYSTEM_EGL_DISPLAY_H
|
||||
#define _SYSTEM_EGL_DISPLAY_H
|
||||
|
||||
#include <pthread.h>
|
||||
#include "glUtils.h"
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include "EGLClientIface.h"
|
||||
#include <utils/KeyedVector.h>
|
||||
|
||||
#include <ui/PixelFormat.h>
|
||||
|
||||
#define ATTRIBUTE_NONE -1
|
||||
//FIXME: are we in this namespace?
|
||||
using namespace android;
|
||||
|
||||
class eglDisplay
|
||||
{
|
||||
public:
|
||||
eglDisplay();
|
||||
~eglDisplay();
|
||||
|
||||
bool initialize(EGLClient_eglInterface *eglIface);
|
||||
void terminate();
|
||||
|
||||
int getVersionMajor() const { return m_major; }
|
||||
int getVersionMinor() const { return m_minor; }
|
||||
bool initialized() const { return m_initialized; }
|
||||
|
||||
const char *queryString(EGLint name);
|
||||
|
||||
const EGLClient_glesInterface *gles_iface() const { return m_gles_iface; }
|
||||
const EGLClient_glesInterface *gles2_iface() const { return m_gles2_iface; }
|
||||
|
||||
int getNumConfigs(){ return m_numConfigs; }
|
||||
EGLBoolean getConfigAttrib(EGLConfig config, EGLint attrib, EGLint * value);
|
||||
EGLBoolean setConfigAttrib(EGLConfig config, EGLint attrib, EGLint value);
|
||||
EGLBoolean getConfigGLPixelFormat(EGLConfig config, GLenum * format);
|
||||
EGLBoolean getConfigNativePixelFormat(EGLConfig config, PixelFormat * format);
|
||||
|
||||
void dumpConfig(EGLConfig config);
|
||||
private:
|
||||
EGLClient_glesInterface *loadGLESClientAPI(const char *libName,
|
||||
EGLClient_eglInterface *eglIface,
|
||||
void **libHandle);
|
||||
EGLBoolean getAttribValue(EGLConfig config, EGLint attribIdxi, EGLint * value);
|
||||
EGLBoolean setAttribValue(EGLConfig config, EGLint attribIdxi, EGLint value);
|
||||
void processConfigs();
|
||||
|
||||
private:
|
||||
pthread_mutex_t m_lock;
|
||||
bool m_initialized;
|
||||
int m_major;
|
||||
int m_minor;
|
||||
int m_hostRendererVersion;
|
||||
int m_numConfigs;
|
||||
int m_numConfigAttribs;
|
||||
|
||||
/* This is the mapping between an attribute name to it's index in any given config */
|
||||
DefaultKeyedVector<EGLint, EGLint> m_attribs;
|
||||
/* This is an array of all config's attributes values stored in the following sequencial fasion (read: v[c,a] = the value of attribute <a> of config <c>)
|
||||
* v[0,0],..,v[0,m_numConfigAttribs-1],
|
||||
*...
|
||||
* v[m_numConfigs-1,0],..,v[m_numConfigs-1,m_numConfigAttribs-1]
|
||||
*/
|
||||
EGLint *m_configs;
|
||||
EGLClient_glesInterface *m_gles_iface;
|
||||
EGLClient_glesInterface *m_gles2_iface;
|
||||
char *m_versionString;
|
||||
char *m_vendorString;
|
||||
char *m_extensionString;
|
||||
};
|
||||
|
||||
#endif
|
||||
64
tools/emulator/opengl/system/egl/egl_ftable.h
Normal file
64
tools/emulator/opengl/system/egl/egl_ftable.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
static const struct _egl_funcs_by_name {
|
||||
const char *name;
|
||||
void *proc;
|
||||
} egl_funcs_by_name[] = {
|
||||
{"eglGetError", (void *)eglGetError},
|
||||
{"eglGetDisplay", (void *)eglGetDisplay},
|
||||
{"eglInitialize", (void *)eglInitialize},
|
||||
{"eglTerminate", (void *)eglTerminate},
|
||||
{"eglQueryString", (void *)eglQueryString},
|
||||
{"eglGetConfigs", (void *)eglGetConfigs},
|
||||
{"eglChooseConfig", (void *)eglChooseConfig},
|
||||
{"eglGetConfigAttrib", (void *)eglGetConfigAttrib},
|
||||
{"eglCreateWindowSurface", (void *)eglCreateWindowSurface},
|
||||
{"eglCreatePbufferSurface", (void *)eglCreatePbufferSurface},
|
||||
{"eglCreatePixmapSurface", (void *)eglCreatePixmapSurface},
|
||||
{"eglDestroySurface", (void *)eglDestroySurface},
|
||||
{"eglQuerySurface", (void *)eglQuerySurface},
|
||||
{"eglBindAPI", (void *)eglBindAPI},
|
||||
{"eglQueryAPI", (void *)eglQueryAPI},
|
||||
{"eglWaitClient", (void *)eglWaitClient},
|
||||
{"eglReleaseThread", (void *)eglReleaseThread},
|
||||
{"eglCreatePbufferFromClientBuffer", (void *)eglCreatePbufferFromClientBuffer},
|
||||
{"eglSurfaceAttrib", (void *)eglSurfaceAttrib},
|
||||
{"eglBindTexImage", (void *)eglBindTexImage},
|
||||
{"eglReleaseTexImage", (void *)eglReleaseTexImage},
|
||||
{"eglSwapInterval", (void *)eglSwapInterval},
|
||||
{"eglCreateContext", (void *)eglCreateContext},
|
||||
{"eglDestroyContext", (void *)eglDestroyContext},
|
||||
{"eglMakeCurrent", (void *)eglMakeCurrent},
|
||||
{"eglGetCurrentContext", (void *)eglGetCurrentContext},
|
||||
{"eglGetCurrentSurface", (void *)eglGetCurrentSurface},
|
||||
{"eglGetCurrentDisplay", (void *)eglGetCurrentDisplay},
|
||||
{"eglQueryContext", (void *)eglQueryContext},
|
||||
{"eglWaitGL", (void *)eglWaitGL},
|
||||
{"eglWaitNative", (void *)eglWaitNative},
|
||||
{"eglSwapBuffers", (void *)eglSwapBuffers},
|
||||
{"eglCopyBuffers", (void *)eglCopyBuffers},
|
||||
{"eglGetProcAddress", (void *)eglGetProcAddress},
|
||||
{"eglLockSurfaceKHR", (void *)eglLockSurfaceKHR},
|
||||
{"eglUnlockSurfaceKHR", (void *)eglUnlockSurfaceKHR},
|
||||
{"eglCreateImageKHR", (void *)eglCreateImageKHR},
|
||||
{"eglDestroyImageKHR", (void *)eglDestroyImageKHR},
|
||||
{"eglCreateSyncKHR", (void *)eglCreateSyncKHR},
|
||||
{"eglDestroySyncKHR", (void *)eglDestroySyncKHR},
|
||||
{"eglClientWaitSyncKHR", (void *)eglClientWaitSyncKHR},
|
||||
{"eglGetSyncAttribKHR", (void *)eglGetSyncAttribKHR}
|
||||
};
|
||||
|
||||
static const int egl_num_funcs = sizeof(egl_funcs_by_name) / sizeof(struct _egl_funcs_by_name);
|
||||
19
tools/emulator/opengl/system/gralloc/Android.mk
Normal file
19
tools/emulator/opengl/system/gralloc/Android.mk
Normal file
@@ -0,0 +1,19 @@
|
||||
ifneq (false,$(BUILD_EMULATOR_OPENGL_DRIVER))
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
$(call emugl-begin-shared-library,gralloc.goldfish)
|
||||
$(call emugl-import,libGLESv1_enc lib_renderControl_enc libOpenglSystemCommon)
|
||||
$(call emugl-set-shared-library-subpath,hw)
|
||||
|
||||
LOCAL_CFLAGS += -DLOG_TAG=\"gralloc_goldfish\"
|
||||
|
||||
LOCAL_SRC_FILES := gralloc.cpp
|
||||
|
||||
# Need to access the special OPENGL TLS Slot
|
||||
LOCAL_C_INCLUDES += bionic/libc/private
|
||||
LOCAL_SHARED_LIBRARIES += libdl
|
||||
|
||||
$(call emugl-end-module)
|
||||
|
||||
endif # BUILD_EMULATOR_OPENGL_DRIVER != false
|
||||
847
tools/emulator/opengl/system/gralloc/gralloc.cpp
Normal file
847
tools/emulator/opengl/system/gralloc/gralloc.cpp
Normal file
@@ -0,0 +1,847 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_ANDROID_OS // just want PAGE_SIZE define
|
||||
# include <asm/page.h>
|
||||
#else
|
||||
# include <sys/user.h>
|
||||
#endif
|
||||
#include <cutils/ashmem.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/mman.h>
|
||||
#include "gralloc_cb.h"
|
||||
#include "HostConnection.h"
|
||||
#include "glUtils.h"
|
||||
#include <cutils/log.h>
|
||||
#include <cutils/properties.h>
|
||||
|
||||
/* Set to 1 or 2 to enable debug traces */
|
||||
#define DEBUG 0
|
||||
|
||||
#if DEBUG >= 1
|
||||
# define D(...) ALOGD(__VA_ARGS__)
|
||||
#else
|
||||
# define D(...) ((void)0)
|
||||
#endif
|
||||
|
||||
#if DEBUG >= 2
|
||||
# define DD(...) ALOGD(__VA_ARGS__)
|
||||
#else
|
||||
# define DD(...) ((void)0)
|
||||
#endif
|
||||
|
||||
#define DBG_FUNC DBG("%s\n", __FUNCTION__)
|
||||
//
|
||||
// our private gralloc module structure
|
||||
//
|
||||
struct private_module_t {
|
||||
gralloc_module_t base;
|
||||
};
|
||||
|
||||
/* If not NULL, this is a pointer to the fallback module.
|
||||
* This really is gralloc.default, which we'll use if we detect
|
||||
* that the emulator we're running in does not support GPU emulation.
|
||||
*/
|
||||
static gralloc_module_t* sFallback;
|
||||
static pthread_once_t sFallbackOnce = PTHREAD_ONCE_INIT;
|
||||
|
||||
static void fallback_init(void); // forward
|
||||
|
||||
|
||||
typedef struct _alloc_list_node {
|
||||
buffer_handle_t handle;
|
||||
_alloc_list_node *next;
|
||||
_alloc_list_node *prev;
|
||||
} AllocListNode;
|
||||
|
||||
//
|
||||
// Our gralloc device structure (alloc interface)
|
||||
//
|
||||
struct gralloc_device_t {
|
||||
alloc_device_t device;
|
||||
|
||||
AllocListNode *allocListHead; // double linked list of allocated buffers
|
||||
pthread_mutex_t lock;
|
||||
};
|
||||
|
||||
//
|
||||
// Our framebuffer device structure
|
||||
//
|
||||
struct fb_device_t {
|
||||
framebuffer_device_t device;
|
||||
};
|
||||
|
||||
static int map_buffer(cb_handle_t *cb, void **vaddr)
|
||||
{
|
||||
if (cb->fd < 0 || cb->ashmemSize <= 0) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
void *addr = mmap(0, cb->ashmemSize, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, cb->fd, 0);
|
||||
if (addr == MAP_FAILED) {
|
||||
return -errno;
|
||||
}
|
||||
|
||||
cb->ashmemBase = intptr_t(addr);
|
||||
cb->ashmemBasePid = getpid();
|
||||
|
||||
*vaddr = addr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define DEFINE_HOST_CONNECTION \
|
||||
HostConnection *hostCon = HostConnection::get(); \
|
||||
renderControl_encoder_context_t *rcEnc = (hostCon ? hostCon->rcEncoder() : NULL)
|
||||
|
||||
#define DEFINE_AND_VALIDATE_HOST_CONNECTION \
|
||||
HostConnection *hostCon = HostConnection::get(); \
|
||||
if (!hostCon) { \
|
||||
ALOGE("gralloc: Failed to get host connection\n"); \
|
||||
return -EIO; \
|
||||
} \
|
||||
renderControl_encoder_context_t *rcEnc = hostCon->rcEncoder(); \
|
||||
if (!rcEnc) { \
|
||||
ALOGE("gralloc: Failed to get renderControl encoder context\n"); \
|
||||
return -EIO; \
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// gralloc device functions (alloc interface)
|
||||
//
|
||||
static int gralloc_alloc(alloc_device_t* dev,
|
||||
int w, int h, int format, int usage,
|
||||
buffer_handle_t* pHandle, int* pStride)
|
||||
{
|
||||
D("gralloc_alloc w=%d h=%d usage=0x%x\n", w, h, usage);
|
||||
|
||||
gralloc_device_t *grdev = (gralloc_device_t *)dev;
|
||||
if (!grdev || !pHandle || !pStride)
|
||||
return -EINVAL;
|
||||
|
||||
//
|
||||
// Validate usage: buffer cannot be written both by s/w and h/w access.
|
||||
//
|
||||
bool sw_write = (0 != (usage & GRALLOC_USAGE_SW_WRITE_MASK));
|
||||
bool hw_write = (usage & GRALLOC_USAGE_HW_RENDER);
|
||||
if (hw_write && sw_write) {
|
||||
return -EINVAL;
|
||||
}
|
||||
bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK));
|
||||
|
||||
int ashmem_size = 0;
|
||||
int stride = w;
|
||||
|
||||
GLenum glFormat = 0;
|
||||
GLenum glType = 0;
|
||||
|
||||
int bpp = 0;
|
||||
int align = 1;
|
||||
switch (format) {
|
||||
case HAL_PIXEL_FORMAT_RGBA_8888:
|
||||
case HAL_PIXEL_FORMAT_RGBX_8888:
|
||||
case HAL_PIXEL_FORMAT_BGRA_8888:
|
||||
bpp = 4;
|
||||
glFormat = GL_RGBA;
|
||||
glType = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_888:
|
||||
bpp = 3;
|
||||
glFormat = GL_RGB;
|
||||
glType = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_565:
|
||||
bpp = 2;
|
||||
glFormat = GL_RGB;
|
||||
glType = GL_UNSIGNED_SHORT_5_6_5;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBA_5551:
|
||||
bpp = 2;
|
||||
glFormat = GL_RGB5_A1_OES;
|
||||
glType = GL_UNSIGNED_SHORT_5_5_5_1;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBA_4444:
|
||||
bpp = 2;
|
||||
glFormat = GL_RGBA4_OES;
|
||||
glType = GL_UNSIGNED_SHORT_4_4_4_4;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RAW_SENSOR:
|
||||
bpp = 2;
|
||||
align = 16*bpp;
|
||||
if (! (sw_read && sw_write) ) {
|
||||
// Raw sensor data cannot be used by HW
|
||||
return -EINVAL;
|
||||
}
|
||||
glFormat = GL_LUMINANCE;
|
||||
glType = GL_UNSIGNED_SHORT;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (usage & GRALLOC_USAGE_HW_FB) {
|
||||
// keep space for postCounter
|
||||
ashmem_size += sizeof(uint32_t);
|
||||
}
|
||||
|
||||
if (sw_read || sw_write) {
|
||||
// keep space for image on guest memory if SW access is needed
|
||||
|
||||
size_t bpr = (w*bpp + (align-1)) & ~(align-1);
|
||||
ashmem_size += (bpr * h);
|
||||
stride = bpr / bpp;
|
||||
}
|
||||
|
||||
D("gralloc_alloc ashmem_size=%d, stride=%d, tid %d\n", ashmem_size, stride,
|
||||
gettid());
|
||||
|
||||
//
|
||||
// Allocate space in ashmem if needed
|
||||
//
|
||||
int fd = -1;
|
||||
if (ashmem_size > 0) {
|
||||
// round to page size;
|
||||
ashmem_size = (ashmem_size + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1);
|
||||
|
||||
fd = ashmem_create_region("gralloc-buffer", ashmem_size);
|
||||
if (fd < 0) {
|
||||
ALOGE("gralloc_alloc failed to create ashmem region: %s\n",
|
||||
strerror(errno));
|
||||
return -errno;
|
||||
}
|
||||
}
|
||||
|
||||
cb_handle_t *cb = new cb_handle_t(fd, ashmem_size, usage,
|
||||
w, h, glFormat, glType);
|
||||
|
||||
if (ashmem_size > 0) {
|
||||
//
|
||||
// map ashmem region if exist
|
||||
//
|
||||
void *vaddr;
|
||||
int err = map_buffer(cb, &vaddr);
|
||||
if (err) {
|
||||
close(fd);
|
||||
delete cb;
|
||||
return err;
|
||||
}
|
||||
|
||||
cb->setFd(fd);
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate ColorBuffer handle on the host (only if h/w access is allowed)
|
||||
//
|
||||
if (usage & GRALLOC_USAGE_HW_MASK) {
|
||||
DEFINE_HOST_CONNECTION;
|
||||
if (hostCon && rcEnc) {
|
||||
cb->hostHandle = rcEnc->rcCreateColorBuffer(rcEnc, w, h, glFormat);
|
||||
D("Created host ColorBuffer 0x%x\n", cb->hostHandle);
|
||||
}
|
||||
|
||||
if (!cb->hostHandle) {
|
||||
// Could not create colorbuffer on host !!!
|
||||
close(fd);
|
||||
delete cb;
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// alloc succeeded - insert the allocated handle to the allocated list
|
||||
//
|
||||
AllocListNode *node = new AllocListNode();
|
||||
pthread_mutex_lock(&grdev->lock);
|
||||
node->handle = cb;
|
||||
node->next = grdev->allocListHead;
|
||||
node->prev = NULL;
|
||||
if (grdev->allocListHead) {
|
||||
grdev->allocListHead->prev = node;
|
||||
}
|
||||
grdev->allocListHead = node;
|
||||
pthread_mutex_unlock(&grdev->lock);
|
||||
|
||||
*pHandle = cb;
|
||||
*pStride = stride;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gralloc_free(alloc_device_t* dev,
|
||||
buffer_handle_t handle)
|
||||
{
|
||||
const cb_handle_t *cb = (const cb_handle_t *)handle;
|
||||
if (!cb_handle_t::validate((cb_handle_t*)cb)) {
|
||||
ERR("gralloc_free: invalid handle");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cb->hostHandle != 0) {
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
|
||||
rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
|
||||
}
|
||||
|
||||
//
|
||||
// detach and unmap ashmem area if present
|
||||
//
|
||||
if (cb->fd > 0) {
|
||||
if (cb->ashmemSize > 0 && cb->ashmemBase) {
|
||||
munmap((void *)cb->ashmemBase, cb->ashmemSize);
|
||||
}
|
||||
close(cb->fd);
|
||||
}
|
||||
|
||||
// remove it from the allocated list
|
||||
gralloc_device_t *grdev = (gralloc_device_t *)dev;
|
||||
pthread_mutex_lock(&grdev->lock);
|
||||
AllocListNode *n = grdev->allocListHead;
|
||||
while( n && n->handle != cb ) {
|
||||
n = n->next;
|
||||
}
|
||||
if (n) {
|
||||
// buffer found on list - remove it from list
|
||||
if (n->next) {
|
||||
n->next->prev = n->prev;
|
||||
}
|
||||
if (n->prev) {
|
||||
n->prev->next = n->next;
|
||||
}
|
||||
else {
|
||||
grdev->allocListHead = n->next;
|
||||
}
|
||||
|
||||
delete n;
|
||||
}
|
||||
pthread_mutex_unlock(&grdev->lock);
|
||||
|
||||
delete cb;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gralloc_device_close(struct hw_device_t *dev)
|
||||
{
|
||||
gralloc_device_t* d = reinterpret_cast<gralloc_device_t*>(dev);
|
||||
if (d) {
|
||||
|
||||
// free still allocated buffers
|
||||
while( d->allocListHead != NULL ) {
|
||||
gralloc_free(&d->device, d->allocListHead->handle);
|
||||
}
|
||||
|
||||
// free device
|
||||
free(d);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fb_compositionComplete(struct framebuffer_device_t* dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Framebuffer device functions
|
||||
//
|
||||
static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
|
||||
{
|
||||
fb_device_t *fbdev = (fb_device_t *)dev;
|
||||
cb_handle_t *cb = (cb_handle_t *)buffer;
|
||||
|
||||
if (!fbdev || !cb_handle_t::validate(cb) || !cb->canBePosted()) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
// Make sure we have host connection
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
|
||||
// increment the post count of the buffer
|
||||
uint32_t *postCountPtr = (uint32_t *)cb->ashmemBase;
|
||||
if (!postCountPtr) {
|
||||
// This should not happen
|
||||
return -EINVAL;
|
||||
}
|
||||
(*postCountPtr)++;
|
||||
|
||||
// send post request to host
|
||||
rcEnc->rcFBPost(rcEnc, cb->hostHandle);
|
||||
hostCon->flush();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fb_setUpdateRect(struct framebuffer_device_t* dev,
|
||||
int l, int t, int w, int h)
|
||||
{
|
||||
fb_device_t *fbdev = (fb_device_t *)dev;
|
||||
|
||||
if (!fbdev) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
// Make sure we have host connection
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
|
||||
// send request to host
|
||||
// TODO: XXX - should be implemented
|
||||
//rcEnc->rc_XXX
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fb_setSwapInterval(struct framebuffer_device_t* dev,
|
||||
int interval)
|
||||
{
|
||||
fb_device_t *fbdev = (fb_device_t *)dev;
|
||||
|
||||
if (!fbdev) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
// Make sure we have host connection
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
|
||||
// send request to host
|
||||
rcEnc->rcFBSetSwapInterval(rcEnc, interval);
|
||||
hostCon->flush();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fb_close(struct hw_device_t *dev)
|
||||
{
|
||||
fb_device_t *fbdev = (fb_device_t *)dev;
|
||||
|
||||
delete fbdev;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// gralloc module functions - refcount + locking interface
|
||||
//
|
||||
static int gralloc_register_buffer(gralloc_module_t const* module,
|
||||
buffer_handle_t handle)
|
||||
{
|
||||
pthread_once(&sFallbackOnce, fallback_init);
|
||||
if (sFallback != NULL) {
|
||||
return sFallback->registerBuffer(sFallback, handle);
|
||||
}
|
||||
|
||||
D("gralloc_register_buffer(%p) called", handle);
|
||||
|
||||
private_module_t *gr = (private_module_t *)module;
|
||||
cb_handle_t *cb = (cb_handle_t *)handle;
|
||||
if (!gr || !cb_handle_t::validate(cb)) {
|
||||
ERR("gralloc_register_buffer(%p): invalid buffer", cb);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cb->hostHandle != 0) {
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
D("Opening host ColorBuffer 0x%x\n", cb->hostHandle);
|
||||
rcEnc->rcOpenColorBuffer(rcEnc, cb->hostHandle);
|
||||
}
|
||||
|
||||
//
|
||||
// if the color buffer has ashmem region and it is not mapped in this
|
||||
// process map it now.
|
||||
//
|
||||
if (cb->ashmemSize > 0 && cb->mappedPid != getpid()) {
|
||||
void *vaddr;
|
||||
int err = map_buffer(cb, &vaddr);
|
||||
if (err) {
|
||||
ERR("gralloc_register_buffer(%p): map failed: %s", cb, strerror(-err));
|
||||
return -err;
|
||||
}
|
||||
cb->mappedPid = getpid();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gralloc_unregister_buffer(gralloc_module_t const* module,
|
||||
buffer_handle_t handle)
|
||||
{
|
||||
if (sFallback != NULL) {
|
||||
return sFallback->unregisterBuffer(sFallback, handle);
|
||||
}
|
||||
|
||||
private_module_t *gr = (private_module_t *)module;
|
||||
cb_handle_t *cb = (cb_handle_t *)handle;
|
||||
if (!gr || !cb_handle_t::validate(cb)) {
|
||||
ERR("gralloc_unregister_buffer(%p): invalid buffer", cb);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (cb->hostHandle != 0) {
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
|
||||
rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
|
||||
}
|
||||
|
||||
//
|
||||
// unmap ashmem region if it was previously mapped in this process
|
||||
// (through register_buffer)
|
||||
//
|
||||
if (cb->ashmemSize > 0 && cb->mappedPid == getpid()) {
|
||||
void *vaddr;
|
||||
int err = munmap((void *)cb->ashmemBase, cb->ashmemSize);
|
||||
if (err) {
|
||||
ERR("gralloc_unregister_buffer(%p): unmap failed", cb);
|
||||
return -EINVAL;
|
||||
}
|
||||
cb->ashmemBase = NULL;
|
||||
cb->mappedPid = 0;
|
||||
}
|
||||
|
||||
D("gralloc_unregister_buffer(%p) done\n", cb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gralloc_lock(gralloc_module_t const* module,
|
||||
buffer_handle_t handle, int usage,
|
||||
int l, int t, int w, int h,
|
||||
void** vaddr)
|
||||
{
|
||||
if (sFallback != NULL) {
|
||||
return sFallback->lock(sFallback, handle, usage, l, t, w, h, vaddr);
|
||||
}
|
||||
|
||||
private_module_t *gr = (private_module_t *)module;
|
||||
cb_handle_t *cb = (cb_handle_t *)handle;
|
||||
if (!gr || !cb_handle_t::validate(cb)) {
|
||||
ALOGE("gralloc_lock bad handle\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
// Validate usage,
|
||||
// 1. cannot be locked for hw access
|
||||
// 2. lock for either sw read or write.
|
||||
// 3. locked sw access must match usage during alloc time.
|
||||
bool sw_read = (0 != (usage & GRALLOC_USAGE_SW_READ_MASK));
|
||||
bool sw_write = (0 != (usage & GRALLOC_USAGE_SW_WRITE_MASK));
|
||||
bool hw_read = (usage & GRALLOC_USAGE_HW_TEXTURE);
|
||||
bool hw_write = (usage & GRALLOC_USAGE_HW_RENDER);
|
||||
bool sw_read_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_READ_MASK));
|
||||
bool sw_write_allowed = (0 != (cb->usage & GRALLOC_USAGE_SW_WRITE_MASK));
|
||||
|
||||
if ( (hw_read || hw_write) ||
|
||||
(!sw_read && !sw_write) ||
|
||||
(sw_read && !sw_read_allowed) ||
|
||||
(sw_write && !sw_write_allowed) ) {
|
||||
ALOGE("gralloc_lock usage mismatch usage=0x%x cb->usage=0x%x\n", usage, cb->usage);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
EGLint postCount = 0;
|
||||
void *cpu_addr = NULL;
|
||||
|
||||
//
|
||||
// make sure ashmem area is mapped if needed
|
||||
//
|
||||
if (cb->canBePosted() || sw_read || sw_write) {
|
||||
if (cb->ashmemBasePid != getpid() || !cb->ashmemBase) {
|
||||
return -EACCES;
|
||||
}
|
||||
|
||||
if (cb->canBePosted()) {
|
||||
postCount = *((int *)cb->ashmemBase);
|
||||
cpu_addr = (void *)(cb->ashmemBase + sizeof(int));
|
||||
}
|
||||
else {
|
||||
cpu_addr = (void *)(cb->ashmemBase);
|
||||
}
|
||||
}
|
||||
|
||||
if (cb->hostHandle) {
|
||||
// Make sure we have host connection
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
|
||||
//
|
||||
// flush color buffer write cache on host and get its sync status.
|
||||
//
|
||||
int hostSyncStatus = rcEnc->rcColorBufferCacheFlush(rcEnc, cb->hostHandle,
|
||||
postCount,
|
||||
sw_read);
|
||||
if (hostSyncStatus < 0) {
|
||||
// host failed the color buffer sync - probably since it was already
|
||||
// locked for write access. fail the lock.
|
||||
ALOGE("gralloc_lock cacheFlush failed postCount=%d sw_read=%d\n",
|
||||
postCount, sw_read);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// is virtual address required ?
|
||||
//
|
||||
if (sw_read || sw_write) {
|
||||
*vaddr = cpu_addr;
|
||||
}
|
||||
|
||||
if (sw_write) {
|
||||
//
|
||||
// Keep locked region if locked for s/w write access.
|
||||
//
|
||||
cb->lockedLeft = l;
|
||||
cb->lockedTop = t;
|
||||
cb->lockedWidth = w;
|
||||
cb->lockedHeight = h;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gralloc_unlock(gralloc_module_t const* module,
|
||||
buffer_handle_t handle)
|
||||
{
|
||||
if (sFallback != NULL) {
|
||||
return sFallback->unlock(sFallback, handle);
|
||||
}
|
||||
|
||||
private_module_t *gr = (private_module_t *)module;
|
||||
cb_handle_t *cb = (cb_handle_t *)handle;
|
||||
if (!gr || !cb_handle_t::validate(cb)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
//
|
||||
// if buffer was locked for s/w write, we need to update the host with
|
||||
// the updated data
|
||||
//
|
||||
if (cb->lockedWidth > 0 && cb->lockedHeight > 0 && cb->hostHandle) {
|
||||
|
||||
// Make sure we have host connection
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
|
||||
void *cpu_addr;
|
||||
if (cb->canBePosted()) {
|
||||
cpu_addr = (void *)(cb->ashmemBase + sizeof(int));
|
||||
}
|
||||
else {
|
||||
cpu_addr = (void *)(cb->ashmemBase);
|
||||
}
|
||||
|
||||
if (cb->lockedWidth < cb->width || cb->lockedHeight < cb->height) {
|
||||
int bpp = glUtilsPixelBitSize(cb->glFormat, cb->glType) >> 3;
|
||||
char *tmpBuf = new char[cb->lockedWidth * cb->lockedHeight * bpp];
|
||||
|
||||
int dst_line_len = cb->lockedWidth * bpp;
|
||||
int src_line_len = cb->width * bpp;
|
||||
char *src = (char *)cpu_addr + cb->lockedTop*src_line_len + cb->lockedLeft*bpp;
|
||||
char *dst = tmpBuf;
|
||||
for (int y=0; y<cb->lockedHeight; y++) {
|
||||
memcpy(dst, src, dst_line_len);
|
||||
src += src_line_len;
|
||||
dst += dst_line_len;
|
||||
}
|
||||
|
||||
rcEnc->rcUpdateColorBuffer(rcEnc, cb->hostHandle,
|
||||
cb->lockedLeft, cb->lockedTop,
|
||||
cb->lockedWidth, cb->lockedHeight,
|
||||
cb->glFormat, cb->glType,
|
||||
tmpBuf);
|
||||
|
||||
delete [] tmpBuf;
|
||||
}
|
||||
else {
|
||||
rcEnc->rcUpdateColorBuffer(rcEnc, cb->hostHandle, 0, 0,
|
||||
cb->width, cb->height,
|
||||
cb->glFormat, cb->glType,
|
||||
cpu_addr);
|
||||
}
|
||||
}
|
||||
|
||||
cb->lockedWidth = cb->lockedHeight = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int gralloc_device_open(const hw_module_t* module,
|
||||
const char* name,
|
||||
hw_device_t** device)
|
||||
{
|
||||
int status = -EINVAL;
|
||||
|
||||
D("gralloc_device_open %s\n", name);
|
||||
|
||||
pthread_once( &sFallbackOnce, fallback_init );
|
||||
if (sFallback != NULL) {
|
||||
return sFallback->common.methods->open(&sFallback->common, name, device);
|
||||
}
|
||||
|
||||
if (!strcmp(name, GRALLOC_HARDWARE_GPU0)) {
|
||||
|
||||
// Create host connection and keep it in the TLS.
|
||||
// return error if connection with host can not be established
|
||||
HostConnection *hostCon = HostConnection::get();
|
||||
if (!hostCon) {
|
||||
ALOGE("gralloc: failed to get host connection while opening %s\n", name);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate memory for the gralloc device (alloc interface)
|
||||
//
|
||||
gralloc_device_t *dev;
|
||||
dev = (gralloc_device_t*)malloc(sizeof(gralloc_device_t));
|
||||
if (NULL == dev) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
// Initialize our device structure
|
||||
//
|
||||
dev->device.common.tag = HARDWARE_DEVICE_TAG;
|
||||
dev->device.common.version = 0;
|
||||
dev->device.common.module = const_cast<hw_module_t*>(module);
|
||||
dev->device.common.close = gralloc_device_close;
|
||||
|
||||
dev->device.alloc = gralloc_alloc;
|
||||
dev->device.free = gralloc_free;
|
||||
dev->allocListHead = NULL;
|
||||
pthread_mutex_init(&dev->lock, NULL);
|
||||
|
||||
*device = &dev->device.common;
|
||||
status = 0;
|
||||
}
|
||||
else if (!strcmp(name, GRALLOC_HARDWARE_FB0)) {
|
||||
|
||||
// return error if connection with host can not be established
|
||||
DEFINE_AND_VALIDATE_HOST_CONNECTION;
|
||||
|
||||
//
|
||||
// Query the host for Framebuffer attributes
|
||||
//
|
||||
D("gralloc: query Frabuffer attribs\n");
|
||||
EGLint width = rcEnc->rcGetFBParam(rcEnc, FB_WIDTH);
|
||||
D("gralloc: width=%d\n", width);
|
||||
EGLint height = rcEnc->rcGetFBParam(rcEnc, FB_HEIGHT);
|
||||
D("gralloc: height=%d\n", height);
|
||||
EGLint xdpi = rcEnc->rcGetFBParam(rcEnc, FB_XDPI);
|
||||
D("gralloc: xdpi=%d\n", xdpi);
|
||||
EGLint ydpi = rcEnc->rcGetFBParam(rcEnc, FB_YDPI);
|
||||
D("gralloc: ydpi=%d\n", ydpi);
|
||||
EGLint fps = rcEnc->rcGetFBParam(rcEnc, FB_FPS);
|
||||
D("gralloc: fps=%d\n", fps);
|
||||
EGLint min_si = rcEnc->rcGetFBParam(rcEnc, FB_MIN_SWAP_INTERVAL);
|
||||
D("gralloc: min_swap=%d\n", min_si);
|
||||
EGLint max_si = rcEnc->rcGetFBParam(rcEnc, FB_MAX_SWAP_INTERVAL);
|
||||
D("gralloc: max_swap=%d\n", max_si);
|
||||
|
||||
//
|
||||
// Allocate memory for the framebuffer device
|
||||
//
|
||||
fb_device_t *dev;
|
||||
dev = (fb_device_t*)malloc(sizeof(fb_device_t));
|
||||
if (NULL == dev) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(dev, 0, sizeof(fb_device_t));
|
||||
|
||||
// Initialize our device structure
|
||||
//
|
||||
dev->device.common.tag = HARDWARE_DEVICE_TAG;
|
||||
dev->device.common.version = 0;
|
||||
dev->device.common.module = const_cast<hw_module_t*>(module);
|
||||
dev->device.common.close = fb_close;
|
||||
dev->device.setSwapInterval = fb_setSwapInterval;
|
||||
dev->device.post = fb_post;
|
||||
dev->device.setUpdateRect = 0; //fb_setUpdateRect;
|
||||
dev->device.compositionComplete = fb_compositionComplete; //XXX: this is a dummy
|
||||
|
||||
const_cast<uint32_t&>(dev->device.flags) = 0;
|
||||
const_cast<uint32_t&>(dev->device.width) = width;
|
||||
const_cast<uint32_t&>(dev->device.height) = height;
|
||||
const_cast<int&>(dev->device.stride) = width;
|
||||
const_cast<int&>(dev->device.format) = HAL_PIXEL_FORMAT_RGBA_8888;
|
||||
const_cast<float&>(dev->device.xdpi) = xdpi;
|
||||
const_cast<float&>(dev->device.ydpi) = ydpi;
|
||||
const_cast<float&>(dev->device.fps) = fps;
|
||||
const_cast<int&>(dev->device.minSwapInterval) = min_si;
|
||||
const_cast<int&>(dev->device.maxSwapInterval) = max_si;
|
||||
*device = &dev->device.common;
|
||||
|
||||
status = 0;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
//
|
||||
// define the HMI symbol - our module interface
|
||||
//
|
||||
static struct hw_module_methods_t gralloc_module_methods = {
|
||||
open: gralloc_device_open
|
||||
};
|
||||
|
||||
struct private_module_t HAL_MODULE_INFO_SYM = {
|
||||
base: {
|
||||
common: {
|
||||
tag: HARDWARE_MODULE_TAG,
|
||||
version_major: 1,
|
||||
version_minor: 0,
|
||||
id: GRALLOC_HARDWARE_MODULE_ID,
|
||||
name: "Graphics Memory Allocator Module",
|
||||
author: "The Android Open Source Project",
|
||||
methods: &gralloc_module_methods,
|
||||
dso: NULL,
|
||||
reserved: {0, }
|
||||
},
|
||||
registerBuffer: gralloc_register_buffer,
|
||||
unregisterBuffer: gralloc_unregister_buffer,
|
||||
lock: gralloc_lock,
|
||||
unlock: gralloc_unlock,
|
||||
perform: NULL,
|
||||
reserved_proc : {NULL, }
|
||||
}
|
||||
};
|
||||
|
||||
/* This function is called once to detect whether the emulator supports
|
||||
* GPU emulation (this is done by looking at the qemu.gles kernel
|
||||
* parameter, which must be > 0 if this is the case).
|
||||
*
|
||||
* If not, then load gralloc.default instead as a fallback.
|
||||
*/
|
||||
static void
|
||||
fallback_init(void)
|
||||
{
|
||||
char prop[PROPERTY_VALUE_MAX];
|
||||
void* module;
|
||||
|
||||
property_get("ro.kernel.qemu.gles", prop, "0");
|
||||
if (atoi(prop) > 0) {
|
||||
return;
|
||||
}
|
||||
ALOGD("Emulator without GPU emulation detected.");
|
||||
module = dlopen("/system/lib/hw/gralloc.default.so", RTLD_LAZY|RTLD_LOCAL);
|
||||
if (module != NULL) {
|
||||
sFallback = reinterpret_cast<gralloc_module_t*>(dlsym(module, HAL_MODULE_INFO_SYM_AS_STR));
|
||||
if (sFallback == NULL) {
|
||||
dlclose(module);
|
||||
}
|
||||
}
|
||||
if (sFallback == NULL) {
|
||||
ALOGE("Could not find software fallback module!?");
|
||||
}
|
||||
}
|
||||
12
tools/emulator/opengl/system/renderControl_enc/Android.mk
Normal file
12
tools/emulator/opengl/system/renderControl_enc/Android.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
$(call emugl-begin-shared-library,lib_renderControl_enc)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
renderControl_client_context.cpp \
|
||||
renderControl_enc.cpp \
|
||||
renderControl_entry.cpp
|
||||
|
||||
$(call emugl-export,C_INCLUDES,$(LOCAL_PATH))
|
||||
$(call emugl-import,libOpenglCodecCommon)
|
||||
$(call emugl-end-module)
|
||||
136
tools/emulator/opengl/system/renderControl_enc/README
Normal file
136
tools/emulator/opengl/system/renderControl_enc/README
Normal file
@@ -0,0 +1,136 @@
|
||||
The renderControl.in file in this directory defines an API which is decoded
|
||||
on the android guest into a stream and get decoded and executed on the host.
|
||||
It is used in order to query the host renderer as well as send the host renderer
|
||||
control commands.
|
||||
|
||||
The following describes each of the entries defined by this renderControl API.
|
||||
|
||||
|
||||
GLint rcGetRendererVersion();
|
||||
This function queries the host renderer version number.
|
||||
|
||||
EGLint rcGetEGLVersion(EGLint* major, EGLint* minor);
|
||||
This function queries the host renderer for the EGL version
|
||||
it supports. returns EGL_FALSE on failure.
|
||||
|
||||
EGLint rcQueryEGLString(EGLenum name, void* buffer, EGLint bufferSize);
|
||||
This function queries the host for EGL string (.i.e EGL_EXTENSIONS).
|
||||
if buffer is NULL or the bufferSize is not big enough the return value
|
||||
is the negative number of bytes required to store the string value
|
||||
otherwise the string value is copied to buffer and its size is
|
||||
returned.
|
||||
|
||||
EGLint rcGetNumConfigs(uint32_t* numAttribs);
|
||||
queries the host for the number of supported EGL configs.
|
||||
The function returns the number of supported configs and returns in
|
||||
numAttribs the number of attributes available for each config.
|
||||
|
||||
EGLint rcGetConfigs(uint32_t bufSize, GLuint* buffer);
|
||||
This function queries the host for the all set of supported configs
|
||||
with their attribute values.
|
||||
bufSize is the size of buffer, the size should be at least equal to
|
||||
(numConfigs + 1) * numAttribs * sizeof(GLuint)
|
||||
where numConfigs and numAttribs are the values returned in
|
||||
rcGetNumConfigs. if bufSize is not big enough then the negative number
|
||||
of required bytes is returned otherwise the function returns the number
|
||||
of configs and buffer is filled as follows: The first 'numAttribs'
|
||||
integer values are filled with the EGL enumerant describing a config
|
||||
attribute, next for each config there are 'numAttribs' integer values
|
||||
holding the attribute values for that config, the values are specified
|
||||
in the same order as the attribute vector.
|
||||
|
||||
EGLint rcChooseConfig(EGLint *attribs, uint32_t attribs_size, uint32_t *configs, uint32_t configs_size)
|
||||
This function triggers an eglChooseConfig on the host, to get a list of
|
||||
configs matching the given attribs values.
|
||||
attribs - a list of attribute names followed by the desired values, terminated by EGL_NONE
|
||||
attribs_size - the size of the list
|
||||
configs - the returned matching configuration names (same names as familiar to the client in rcGetConfigs)
|
||||
configs_size - the size of the configs buffers
|
||||
returns - the actual number of matching configurations (<= configs_size)
|
||||
|
||||
EGLint rcGetFBParam(EGLint param);
|
||||
queries the host for framebuffer parameter, see renderControl_types.h
|
||||
for possible values of 'param'.
|
||||
|
||||
uint32_t rcCreateContext(uint32_t config, uint32_t share, uint32_t glVersion);
|
||||
This function creates a rendering context on the host and returns its
|
||||
handle. config is the config index for the context, share is either zero
|
||||
or a handle to a sharing context. glVersion is either 1 or 2 for GLES1
|
||||
or GLES2 context respectively.
|
||||
|
||||
|
||||
void rcDestroyContext(uint32_t context);
|
||||
This function destroys a rendering context on the host.
|
||||
context is a handle returned in rcCreateContext.
|
||||
|
||||
uint32_t rcCreateWindowSurface(uint32_t config, uint32_t width, uint32_t height);
|
||||
This function creates a 'window' surface on the host which can be then
|
||||
bind for rendering through rcMakeCurrent.
|
||||
The function returns a handle to the created window surface.
|
||||
|
||||
void rcDestroyWindowSurface(uint32_t windowSurface);
|
||||
This function destoys a window surface.
|
||||
|
||||
uint32_t rcCreateColorBuffer(uint32_t width, uint32_t height, GLenum internalFormat);
|
||||
This function creates a colorBuffer object on the host which can be then
|
||||
be specified as a render target for a window surface through
|
||||
rcSetWindowColorBuffer or to be displayed on the framebuffer window
|
||||
through rcFBPost.
|
||||
The function returns a handle to the colorBuffer object, with an initial
|
||||
reference count of 1.
|
||||
|
||||
void rcOpenColorBuffer(uint32_t colorbuffer);
|
||||
Adds an additional reference to the colorbuffer, typically from a
|
||||
different Android process than the one which created it.
|
||||
|
||||
void rcCloseColorBuffer(uint32_t colorbuffer);
|
||||
Removes a reference to the colorbuffer. When the reference count drops
|
||||
to zero the colorbuffer is automatically destroyed.
|
||||
|
||||
void rcFlushWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
|
||||
This flushes the current window color buffer
|
||||
|
||||
void rcSetWindowColorBuffer(uint32_t windowSurface, uint32_t colorBuffer);
|
||||
This set the target color buffer for a windowSurface, when set the
|
||||
previous target colorBuffer gets updated before switching to the new
|
||||
colorBuffer.
|
||||
|
||||
EGLint rcMakeCurrent(uint32_t context, uint32_t drawSurf, uint32_t readSurf);
|
||||
Binds a windowSurface(s) and current rendering context for the
|
||||
calling thread.
|
||||
|
||||
void rcFBPost(uint32_t colorBuffer);
|
||||
This function causes the content of the colorBuffer object to be
|
||||
displayed on the host framebuffer window. The function returns
|
||||
immediatly, the buffer will be displayed at the next swap interval.
|
||||
|
||||
void rcFBSetSwapInterval(EGLint interval);
|
||||
Sets the swap interval for the host framebuffer window.
|
||||
|
||||
void rcBindTexture(uint32_t colorBuffer);
|
||||
This function instruct the host to bind the content of the specified
|
||||
colorBuffer to the current binded texture object of the calling thread.
|
||||
This function should be used to implement eglBindTexImage.
|
||||
|
||||
EGLint rcColorBufferCacheFlush(uint32_t colorbuffer, EGLint postCount, int forRead);
|
||||
This function returns only after all rendering requests for the specified
|
||||
colorBuffer rendering target has been processed and after all 'postCount'
|
||||
posts for the buffer requested previously through rcFBPost has been
|
||||
processed.
|
||||
if 'forRead' is not-zero, the function returns positive value in case
|
||||
there was rendering done to the buffer since the last CacheFlush request
|
||||
with non-zero 'forRead' value, otherwise the function returns zero or
|
||||
negative value on failure.
|
||||
|
||||
void rcReadColorBuffer(uint32_t colorbuffer, GLint x, GLint y,
|
||||
GLint width, GLint height, GLenum format,
|
||||
GLenum type, void* pixels);
|
||||
This function queries the host for the pixel content of a colorBuffer's
|
||||
subregion. It act the same as OpenGL glReadPixels however pixels
|
||||
are always packed with alignment of 1.
|
||||
|
||||
void rcUpdateColorBuffer(uint32_t colorbuffer, GLint x, GLint y,
|
||||
GLint width, GLint height, GLenum format,
|
||||
GLenum type, void* pixels);
|
||||
Updates the content of a subregion of a colorBuffer object.
|
||||
pixels are always unpacked with alignment of 1.
|
||||
@@ -0,0 +1,41 @@
|
||||
GLOBAL
|
||||
base_opcode 10000
|
||||
encoder_headers <stdint.h> <EGL/egl.h> "glUtils.h"
|
||||
|
||||
rcGetEGLVersion
|
||||
dir major out
|
||||
len major sizeof(EGLint)
|
||||
dir minor out
|
||||
len minor sizeof(EGLint)
|
||||
|
||||
rcQueryEGLString
|
||||
dir buffer out
|
||||
len buffer bufferSize
|
||||
|
||||
rcGetGLString
|
||||
dir buffer out
|
||||
len buffer bufferSize
|
||||
|
||||
rcGetNumConfigs
|
||||
dir numAttribs out
|
||||
len numAttribs sizeof(uint32_t)
|
||||
|
||||
rcGetConfigs
|
||||
dir buffer out
|
||||
len buffer bufSize
|
||||
|
||||
rcChooseConfig
|
||||
dir attribs in
|
||||
len attribs attribs_size
|
||||
dir configs out
|
||||
var_flag configs nullAllowed
|
||||
len configs configs_size*sizeof(uint32_t)
|
||||
|
||||
rcReadColorBuffer
|
||||
dir pixels out
|
||||
len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height)
|
||||
|
||||
rcUpdateColorBuffer
|
||||
dir pixels in
|
||||
len pixels (((glUtilsPixelBitSize(format, type) * width) >> 3) * height)
|
||||
var_flag pixels isLarge
|
||||
@@ -0,0 +1,25 @@
|
||||
GL_ENRTY(GLint, rcGetRendererVersion)
|
||||
GL_ENTRY(EGLint, rcGetEGLVersion, EGLint *major, EGLint *minor)
|
||||
GL_ENTRY(EGLint, rcQueryEGLString, EGLenum name, void *buffer, EGLint bufferSize)
|
||||
GL_ENTRY(EGLint, rcGetGLString, EGLenum name, void *buffer, EGLint bufferSize)
|
||||
GL_ENTRY(EGLint, rcGetNumConfigs, uint32_t *numAttribs)
|
||||
GL_ENTRY(EGLint, rcGetConfigs, uint32_t bufSize, GLuint *buffer)
|
||||
GL_ENTRY(EGLint, rcChooseConfig, EGLint *attribs, uint32_t attribs_size, uint32_t *configs, uint32_t configs_size)
|
||||
GL_ENTRY(EGLint, rcGetFBParam, EGLint param)
|
||||
GL_ENTRY(uint32_t, rcCreateContext, uint32_t config, uint32_t share, uint32_t glVersion)
|
||||
GL_ENTRY(void, rcDestroyContext, uint32_t context)
|
||||
GL_ENTRY(uint32_t, rcCreateWindowSurface, uint32_t config, uint32_t width, uint32_t height)
|
||||
GL_ENTRY(void, rcDestroyWindowSurface, uint32_t windowSurface)
|
||||
GL_ENTRY(uint32_t, rcCreateColorBuffer, uint32_t width, uint32_t height, GLenum internalFormat)
|
||||
GL_ENTRY(void, rcOpenColorBuffer, uint32_t colorbuffer)
|
||||
GL_ENTRY(void, rcCloseColorBuffer, uint32_t colorbuffer)
|
||||
GL_ENTRY(void, rcSetWindowColorBuffer, uint32_t windowSurface, uint32_t colorBuffer)
|
||||
GL_ENTRY(int, rcFlushWindowColorBuffer, uint32_t windowSurface)
|
||||
GL_ENTRY(EGLint, rcMakeCurrent, uint32_t context, uint32_t drawSurf, uint32_t readSurf)
|
||||
GL_ENTRY(void, rcFBPost, uint32_t colorBuffer)
|
||||
GL_ENTRY(void, rcFBSetSwapInterval, EGLint interval)
|
||||
GL_ENTRY(void, rcBindTexture, uint32_t colorBuffer)
|
||||
GL_ENTRY(void, rcBindRenderbuffer, uint32_t colorBuffer)
|
||||
GL_ENTRY(EGLint, rcColorBufferCacheFlush, uint32_t colorbuffer, EGLint postCount,int forRead)
|
||||
GL_ENTRY(void, rcReadColorBuffer, uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void *pixels)
|
||||
GL_ENTRY(int, rcUpdateColorBuffer, uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void *pixels)
|
||||
@@ -0,0 +1,11 @@
|
||||
uint32_t 32 0x%08x false
|
||||
EGLint 32 0x%08x false
|
||||
GLint 32 0x%08x false
|
||||
GLuint 32 0x%08x false
|
||||
GLenum 32 0x%08x false
|
||||
EGLenum 32 0x%08x false
|
||||
uint32_t* 32 0x%08x true
|
||||
EGLint* 32 0x%08x true
|
||||
GLint* 32 0x%08x true
|
||||
GLuint* 32 0x%08x true
|
||||
void* 32 0x%08x true
|
||||
@@ -0,0 +1,42 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "renderControl_client_context.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int renderControl_client_context_t::initDispatchByName(void *(*getProc)(const char *, void *userData), void *userData)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = getProc("rcGetRendererVersion", userData); set_rcGetRendererVersion((rcGetRendererVersion_client_proc_t)ptr);
|
||||
ptr = getProc("rcGetEGLVersion", userData); set_rcGetEGLVersion((rcGetEGLVersion_client_proc_t)ptr);
|
||||
ptr = getProc("rcQueryEGLString", userData); set_rcQueryEGLString((rcQueryEGLString_client_proc_t)ptr);
|
||||
ptr = getProc("rcGetGLString", userData); set_rcGetGLString((rcGetGLString_client_proc_t)ptr);
|
||||
ptr = getProc("rcGetNumConfigs", userData); set_rcGetNumConfigs((rcGetNumConfigs_client_proc_t)ptr);
|
||||
ptr = getProc("rcGetConfigs", userData); set_rcGetConfigs((rcGetConfigs_client_proc_t)ptr);
|
||||
ptr = getProc("rcChooseConfig", userData); set_rcChooseConfig((rcChooseConfig_client_proc_t)ptr);
|
||||
ptr = getProc("rcGetFBParam", userData); set_rcGetFBParam((rcGetFBParam_client_proc_t)ptr);
|
||||
ptr = getProc("rcCreateContext", userData); set_rcCreateContext((rcCreateContext_client_proc_t)ptr);
|
||||
ptr = getProc("rcDestroyContext", userData); set_rcDestroyContext((rcDestroyContext_client_proc_t)ptr);
|
||||
ptr = getProc("rcCreateWindowSurface", userData); set_rcCreateWindowSurface((rcCreateWindowSurface_client_proc_t)ptr);
|
||||
ptr = getProc("rcDestroyWindowSurface", userData); set_rcDestroyWindowSurface((rcDestroyWindowSurface_client_proc_t)ptr);
|
||||
ptr = getProc("rcCreateColorBuffer", userData); set_rcCreateColorBuffer((rcCreateColorBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("rcOpenColorBuffer", userData); set_rcOpenColorBuffer((rcOpenColorBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("rcCloseColorBuffer", userData); set_rcCloseColorBuffer((rcCloseColorBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("rcSetWindowColorBuffer", userData); set_rcSetWindowColorBuffer((rcSetWindowColorBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("rcFlushWindowColorBuffer", userData); set_rcFlushWindowColorBuffer((rcFlushWindowColorBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("rcMakeCurrent", userData); set_rcMakeCurrent((rcMakeCurrent_client_proc_t)ptr);
|
||||
ptr = getProc("rcFBPost", userData); set_rcFBPost((rcFBPost_client_proc_t)ptr);
|
||||
ptr = getProc("rcFBSetSwapInterval", userData); set_rcFBSetSwapInterval((rcFBSetSwapInterval_client_proc_t)ptr);
|
||||
ptr = getProc("rcBindTexture", userData); set_rcBindTexture((rcBindTexture_client_proc_t)ptr);
|
||||
ptr = getProc("rcBindRenderbuffer", userData); set_rcBindRenderbuffer((rcBindRenderbuffer_client_proc_t)ptr);
|
||||
ptr = getProc("rcColorBufferCacheFlush", userData); set_rcColorBufferCacheFlush((rcColorBufferCacheFlush_client_proc_t)ptr);
|
||||
ptr = getProc("rcReadColorBuffer", userData); set_rcReadColorBuffer((rcReadColorBuffer_client_proc_t)ptr);
|
||||
ptr = getProc("rcUpdateColorBuffer", userData); set_rcUpdateColorBuffer((rcUpdateColorBuffer_client_proc_t)ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __renderControl_client_context_t_h
|
||||
#define __renderControl_client_context_t_h
|
||||
|
||||
#include "renderControl_client_proc.h"
|
||||
|
||||
|
||||
struct renderControl_client_context_t {
|
||||
|
||||
rcGetRendererVersion_client_proc_t rcGetRendererVersion;
|
||||
rcGetEGLVersion_client_proc_t rcGetEGLVersion;
|
||||
rcQueryEGLString_client_proc_t rcQueryEGLString;
|
||||
rcGetGLString_client_proc_t rcGetGLString;
|
||||
rcGetNumConfigs_client_proc_t rcGetNumConfigs;
|
||||
rcGetConfigs_client_proc_t rcGetConfigs;
|
||||
rcChooseConfig_client_proc_t rcChooseConfig;
|
||||
rcGetFBParam_client_proc_t rcGetFBParam;
|
||||
rcCreateContext_client_proc_t rcCreateContext;
|
||||
rcDestroyContext_client_proc_t rcDestroyContext;
|
||||
rcCreateWindowSurface_client_proc_t rcCreateWindowSurface;
|
||||
rcDestroyWindowSurface_client_proc_t rcDestroyWindowSurface;
|
||||
rcCreateColorBuffer_client_proc_t rcCreateColorBuffer;
|
||||
rcOpenColorBuffer_client_proc_t rcOpenColorBuffer;
|
||||
rcCloseColorBuffer_client_proc_t rcCloseColorBuffer;
|
||||
rcSetWindowColorBuffer_client_proc_t rcSetWindowColorBuffer;
|
||||
rcFlushWindowColorBuffer_client_proc_t rcFlushWindowColorBuffer;
|
||||
rcMakeCurrent_client_proc_t rcMakeCurrent;
|
||||
rcFBPost_client_proc_t rcFBPost;
|
||||
rcFBSetSwapInterval_client_proc_t rcFBSetSwapInterval;
|
||||
rcBindTexture_client_proc_t rcBindTexture;
|
||||
rcBindRenderbuffer_client_proc_t rcBindRenderbuffer;
|
||||
rcColorBufferCacheFlush_client_proc_t rcColorBufferCacheFlush;
|
||||
rcReadColorBuffer_client_proc_t rcReadColorBuffer;
|
||||
rcUpdateColorBuffer_client_proc_t rcUpdateColorBuffer;
|
||||
//Accessors
|
||||
virtual rcGetRendererVersion_client_proc_t set_rcGetRendererVersion(rcGetRendererVersion_client_proc_t f) { rcGetRendererVersion_client_proc_t retval = rcGetRendererVersion; rcGetRendererVersion = f; return retval;}
|
||||
virtual rcGetEGLVersion_client_proc_t set_rcGetEGLVersion(rcGetEGLVersion_client_proc_t f) { rcGetEGLVersion_client_proc_t retval = rcGetEGLVersion; rcGetEGLVersion = f; return retval;}
|
||||
virtual rcQueryEGLString_client_proc_t set_rcQueryEGLString(rcQueryEGLString_client_proc_t f) { rcQueryEGLString_client_proc_t retval = rcQueryEGLString; rcQueryEGLString = f; return retval;}
|
||||
virtual rcGetGLString_client_proc_t set_rcGetGLString(rcGetGLString_client_proc_t f) { rcGetGLString_client_proc_t retval = rcGetGLString; rcGetGLString = f; return retval;}
|
||||
virtual rcGetNumConfigs_client_proc_t set_rcGetNumConfigs(rcGetNumConfigs_client_proc_t f) { rcGetNumConfigs_client_proc_t retval = rcGetNumConfigs; rcGetNumConfigs = f; return retval;}
|
||||
virtual rcGetConfigs_client_proc_t set_rcGetConfigs(rcGetConfigs_client_proc_t f) { rcGetConfigs_client_proc_t retval = rcGetConfigs; rcGetConfigs = f; return retval;}
|
||||
virtual rcChooseConfig_client_proc_t set_rcChooseConfig(rcChooseConfig_client_proc_t f) { rcChooseConfig_client_proc_t retval = rcChooseConfig; rcChooseConfig = f; return retval;}
|
||||
virtual rcGetFBParam_client_proc_t set_rcGetFBParam(rcGetFBParam_client_proc_t f) { rcGetFBParam_client_proc_t retval = rcGetFBParam; rcGetFBParam = f; return retval;}
|
||||
virtual rcCreateContext_client_proc_t set_rcCreateContext(rcCreateContext_client_proc_t f) { rcCreateContext_client_proc_t retval = rcCreateContext; rcCreateContext = f; return retval;}
|
||||
virtual rcDestroyContext_client_proc_t set_rcDestroyContext(rcDestroyContext_client_proc_t f) { rcDestroyContext_client_proc_t retval = rcDestroyContext; rcDestroyContext = f; return retval;}
|
||||
virtual rcCreateWindowSurface_client_proc_t set_rcCreateWindowSurface(rcCreateWindowSurface_client_proc_t f) { rcCreateWindowSurface_client_proc_t retval = rcCreateWindowSurface; rcCreateWindowSurface = f; return retval;}
|
||||
virtual rcDestroyWindowSurface_client_proc_t set_rcDestroyWindowSurface(rcDestroyWindowSurface_client_proc_t f) { rcDestroyWindowSurface_client_proc_t retval = rcDestroyWindowSurface; rcDestroyWindowSurface = f; return retval;}
|
||||
virtual rcCreateColorBuffer_client_proc_t set_rcCreateColorBuffer(rcCreateColorBuffer_client_proc_t f) { rcCreateColorBuffer_client_proc_t retval = rcCreateColorBuffer; rcCreateColorBuffer = f; return retval;}
|
||||
virtual rcOpenColorBuffer_client_proc_t set_rcOpenColorBuffer(rcOpenColorBuffer_client_proc_t f) { rcOpenColorBuffer_client_proc_t retval = rcOpenColorBuffer; rcOpenColorBuffer = f; return retval;}
|
||||
virtual rcCloseColorBuffer_client_proc_t set_rcCloseColorBuffer(rcCloseColorBuffer_client_proc_t f) { rcCloseColorBuffer_client_proc_t retval = rcCloseColorBuffer; rcCloseColorBuffer = f; return retval;}
|
||||
virtual rcSetWindowColorBuffer_client_proc_t set_rcSetWindowColorBuffer(rcSetWindowColorBuffer_client_proc_t f) { rcSetWindowColorBuffer_client_proc_t retval = rcSetWindowColorBuffer; rcSetWindowColorBuffer = f; return retval;}
|
||||
virtual rcFlushWindowColorBuffer_client_proc_t set_rcFlushWindowColorBuffer(rcFlushWindowColorBuffer_client_proc_t f) { rcFlushWindowColorBuffer_client_proc_t retval = rcFlushWindowColorBuffer; rcFlushWindowColorBuffer = f; return retval;}
|
||||
virtual rcMakeCurrent_client_proc_t set_rcMakeCurrent(rcMakeCurrent_client_proc_t f) { rcMakeCurrent_client_proc_t retval = rcMakeCurrent; rcMakeCurrent = f; return retval;}
|
||||
virtual rcFBPost_client_proc_t set_rcFBPost(rcFBPost_client_proc_t f) { rcFBPost_client_proc_t retval = rcFBPost; rcFBPost = f; return retval;}
|
||||
virtual rcFBSetSwapInterval_client_proc_t set_rcFBSetSwapInterval(rcFBSetSwapInterval_client_proc_t f) { rcFBSetSwapInterval_client_proc_t retval = rcFBSetSwapInterval; rcFBSetSwapInterval = f; return retval;}
|
||||
virtual rcBindTexture_client_proc_t set_rcBindTexture(rcBindTexture_client_proc_t f) { rcBindTexture_client_proc_t retval = rcBindTexture; rcBindTexture = f; return retval;}
|
||||
virtual rcBindRenderbuffer_client_proc_t set_rcBindRenderbuffer(rcBindRenderbuffer_client_proc_t f) { rcBindRenderbuffer_client_proc_t retval = rcBindRenderbuffer; rcBindRenderbuffer = f; return retval;}
|
||||
virtual rcColorBufferCacheFlush_client_proc_t set_rcColorBufferCacheFlush(rcColorBufferCacheFlush_client_proc_t f) { rcColorBufferCacheFlush_client_proc_t retval = rcColorBufferCacheFlush; rcColorBufferCacheFlush = f; return retval;}
|
||||
virtual rcReadColorBuffer_client_proc_t set_rcReadColorBuffer(rcReadColorBuffer_client_proc_t f) { rcReadColorBuffer_client_proc_t retval = rcReadColorBuffer; rcReadColorBuffer = f; return retval;}
|
||||
virtual rcUpdateColorBuffer_client_proc_t set_rcUpdateColorBuffer(rcUpdateColorBuffer_client_proc_t f) { rcUpdateColorBuffer_client_proc_t retval = rcUpdateColorBuffer; rcUpdateColorBuffer = f; return retval;}
|
||||
virtual ~renderControl_client_context_t() {}
|
||||
|
||||
typedef renderControl_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
|
||||
static void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);
|
||||
int initDispatchByName( void *(*getProc)(const char *name, void *userData), void *userData);
|
||||
virtual void setError(unsigned int error){};
|
||||
virtual unsigned int getError(){ return 0; };
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,39 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
#ifndef __renderControl_client_proc_t_h
|
||||
#define __renderControl_client_proc_t_h
|
||||
|
||||
|
||||
|
||||
#include "renderControl_types.h"
|
||||
#ifndef renderControl_APIENTRY
|
||||
#define renderControl_APIENTRY
|
||||
#endif
|
||||
typedef GLint (renderControl_APIENTRY *rcGetRendererVersion_client_proc_t) (void * ctx);
|
||||
typedef EGLint (renderControl_APIENTRY *rcGetEGLVersion_client_proc_t) (void * ctx, EGLint*, EGLint*);
|
||||
typedef EGLint (renderControl_APIENTRY *rcQueryEGLString_client_proc_t) (void * ctx, EGLenum, void*, EGLint);
|
||||
typedef EGLint (renderControl_APIENTRY *rcGetGLString_client_proc_t) (void * ctx, EGLenum, void*, EGLint);
|
||||
typedef EGLint (renderControl_APIENTRY *rcGetNumConfigs_client_proc_t) (void * ctx, uint32_t*);
|
||||
typedef EGLint (renderControl_APIENTRY *rcGetConfigs_client_proc_t) (void * ctx, uint32_t, GLuint*);
|
||||
typedef EGLint (renderControl_APIENTRY *rcChooseConfig_client_proc_t) (void * ctx, EGLint*, uint32_t, uint32_t*, uint32_t);
|
||||
typedef EGLint (renderControl_APIENTRY *rcGetFBParam_client_proc_t) (void * ctx, EGLint);
|
||||
typedef uint32_t (renderControl_APIENTRY *rcCreateContext_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcDestroyContext_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef uint32_t (renderControl_APIENTRY *rcCreateWindowSurface_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcDestroyWindowSurface_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef uint32_t (renderControl_APIENTRY *rcCreateColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t, GLenum);
|
||||
typedef void (renderControl_APIENTRY *rcOpenColorBuffer_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcCloseColorBuffer_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcSetWindowColorBuffer_client_proc_t) (void * ctx, uint32_t, uint32_t);
|
||||
typedef int (renderControl_APIENTRY *rcFlushWindowColorBuffer_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef EGLint (renderControl_APIENTRY *rcMakeCurrent_client_proc_t) (void * ctx, uint32_t, uint32_t, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcFBPost_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcFBSetSwapInterval_client_proc_t) (void * ctx, EGLint);
|
||||
typedef void (renderControl_APIENTRY *rcBindTexture_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcBindRenderbuffer_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef EGLint (renderControl_APIENTRY *rcColorBufferCacheFlush_client_proc_t) (void * ctx, uint32_t, EGLint, int);
|
||||
typedef void (renderControl_APIENTRY *rcReadColorBuffer_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*);
|
||||
typedef int (renderControl_APIENTRY *rcUpdateColorBuffer_client_proc_t) (void * ctx, uint32_t, GLint, GLint, GLint, GLint, GLenum, GLenum, void*);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,536 @@
|
||||
// Generated Code - DO NOT EDIT !!
|
||||
// generated by 'emugen'
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include "renderControl_opcodes.h"
|
||||
|
||||
#include "renderControl_enc.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
static void enc_unsupported()
|
||||
{
|
||||
ALOGE("Function is unsupported\n");
|
||||
}
|
||||
|
||||
GLint rcGetRendererVersion_enc(void *self )
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcGetRendererVersion;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
|
||||
GLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcGetEGLVersion_enc(void *self , EGLint* major, EGLint* minor)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_major = sizeof(EGLint);
|
||||
const unsigned int __size_minor = sizeof(EGLint);
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + __size_major + __size_minor + 2*4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcGetEGLVersion;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
*(unsigned int *)(ptr) = __size_major; ptr += 4;
|
||||
*(unsigned int *)(ptr) = __size_minor; ptr += 4;
|
||||
stream->readback(major, __size_major);
|
||||
stream->readback(minor, __size_minor);
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcQueryEGLString_enc(void *self , EGLenum name, void* buffer, EGLint bufferSize)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_buffer = bufferSize;
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + __size_buffer + 4 + 1*4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcQueryEGLString;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &name, 4); ptr += 4;
|
||||
*(unsigned int *)(ptr) = __size_buffer; ptr += 4;
|
||||
memcpy(ptr, &bufferSize, 4); ptr += 4;
|
||||
stream->readback(buffer, __size_buffer);
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcGetGLString_enc(void *self , EGLenum name, void* buffer, EGLint bufferSize)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_buffer = bufferSize;
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + __size_buffer + 4 + 1*4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcGetGLString;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &name, 4); ptr += 4;
|
||||
*(unsigned int *)(ptr) = __size_buffer; ptr += 4;
|
||||
memcpy(ptr, &bufferSize, 4); ptr += 4;
|
||||
stream->readback(buffer, __size_buffer);
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcGetNumConfigs_enc(void *self , uint32_t* numAttribs)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_numAttribs = sizeof(uint32_t);
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + __size_numAttribs + 1*4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcGetNumConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
*(unsigned int *)(ptr) = __size_numAttribs; ptr += 4;
|
||||
stream->readback(numAttribs, __size_numAttribs);
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcGetConfigs_enc(void *self , uint32_t bufSize, GLuint* buffer)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_buffer = bufSize;
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + __size_buffer + 1*4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcGetConfigs;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &bufSize, 4); ptr += 4;
|
||||
*(unsigned int *)(ptr) = __size_buffer; ptr += 4;
|
||||
stream->readback(buffer, __size_buffer);
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcChooseConfig_enc(void *self , EGLint* attribs, uint32_t attribs_size, uint32_t* configs, uint32_t configs_size)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_attribs = attribs_size;
|
||||
const unsigned int __size_configs = ((configs != NULL) ? configs_size*sizeof(uint32_t) : 0);
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + __size_attribs + 4 + __size_configs + 4 + 2*4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcChooseConfig;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
*(unsigned int *)(ptr) = __size_attribs; ptr += 4;
|
||||
memcpy(ptr, attribs, __size_attribs);ptr += __size_attribs;
|
||||
memcpy(ptr, &attribs_size, 4); ptr += 4;
|
||||
*(unsigned int *)(ptr) = __size_configs; ptr += 4;
|
||||
memcpy(ptr, &configs_size, 4); ptr += 4;
|
||||
if (configs != NULL) stream->readback(configs, __size_configs);
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcGetFBParam_enc(void *self , EGLint param)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcGetFBParam;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, ¶m, 4); ptr += 4;
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
uint32_t rcCreateContext_enc(void *self , uint32_t config, uint32_t share, uint32_t glVersion)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcCreateContext;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &config, 4); ptr += 4;
|
||||
memcpy(ptr, &share, 4); ptr += 4;
|
||||
memcpy(ptr, &glVersion, 4); ptr += 4;
|
||||
|
||||
uint32_t retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void rcDestroyContext_enc(void *self , uint32_t context)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcDestroyContext;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &context, 4); ptr += 4;
|
||||
}
|
||||
|
||||
uint32_t rcCreateWindowSurface_enc(void *self , uint32_t config, uint32_t width, uint32_t height)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcCreateWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &config, 4); ptr += 4;
|
||||
memcpy(ptr, &width, 4); ptr += 4;
|
||||
memcpy(ptr, &height, 4); ptr += 4;
|
||||
|
||||
uint32_t retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void rcDestroyWindowSurface_enc(void *self , uint32_t windowSurface)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcDestroyWindowSurface;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &windowSurface, 4); ptr += 4;
|
||||
}
|
||||
|
||||
uint32_t rcCreateColorBuffer_enc(void *self , uint32_t width, uint32_t height, GLenum internalFormat)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcCreateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &width, 4); ptr += 4;
|
||||
memcpy(ptr, &height, 4); ptr += 4;
|
||||
memcpy(ptr, &internalFormat, 4); ptr += 4;
|
||||
|
||||
uint32_t retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void rcOpenColorBuffer_enc(void *self , uint32_t colorbuffer)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcOpenColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorbuffer, 4); ptr += 4;
|
||||
}
|
||||
|
||||
void rcCloseColorBuffer_enc(void *self , uint32_t colorbuffer)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcCloseColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorbuffer, 4); ptr += 4;
|
||||
}
|
||||
|
||||
void rcSetWindowColorBuffer_enc(void *self , uint32_t windowSurface, uint32_t colorBuffer)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcSetWindowColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &windowSurface, 4); ptr += 4;
|
||||
memcpy(ptr, &colorBuffer, 4); ptr += 4;
|
||||
}
|
||||
|
||||
int rcFlushWindowColorBuffer_enc(void *self , uint32_t windowSurface)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcFlushWindowColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &windowSurface, 4); ptr += 4;
|
||||
|
||||
int retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
EGLint rcMakeCurrent_enc(void *self , uint32_t context, uint32_t drawSurf, uint32_t readSurf)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcMakeCurrent;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &context, 4); ptr += 4;
|
||||
memcpy(ptr, &drawSurf, 4); ptr += 4;
|
||||
memcpy(ptr, &readSurf, 4); ptr += 4;
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void rcFBPost_enc(void *self , uint32_t colorBuffer)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcFBPost;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorBuffer, 4); ptr += 4;
|
||||
}
|
||||
|
||||
void rcFBSetSwapInterval_enc(void *self , EGLint interval)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcFBSetSwapInterval;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &interval, 4); ptr += 4;
|
||||
}
|
||||
|
||||
void rcBindTexture_enc(void *self , uint32_t colorBuffer)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcBindTexture;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorBuffer, 4); ptr += 4;
|
||||
}
|
||||
|
||||
void rcBindRenderbuffer_enc(void *self , uint32_t colorBuffer)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcBindRenderbuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorBuffer, 4); ptr += 4;
|
||||
}
|
||||
|
||||
EGLint rcColorBufferCacheFlush_enc(void *self , uint32_t colorbuffer, EGLint postCount, int forRead)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4 + 4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcColorBufferCacheFlush;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorbuffer, 4); ptr += 4;
|
||||
memcpy(ptr, &postCount, 4); ptr += 4;
|
||||
memcpy(ptr, &forRead, 4); ptr += 4;
|
||||
|
||||
EGLint retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
void rcReadColorBuffer_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_pixels = (((glUtilsPixelBitSize(format, type) * width) >> 3) * height);
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
|
||||
ptr = stream->alloc(packetSize);
|
||||
int tmp = OP_rcReadColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorbuffer, 4); ptr += 4;
|
||||
memcpy(ptr, &x, 4); ptr += 4;
|
||||
memcpy(ptr, &y, 4); ptr += 4;
|
||||
memcpy(ptr, &width, 4); ptr += 4;
|
||||
memcpy(ptr, &height, 4); ptr += 4;
|
||||
memcpy(ptr, &format, 4); ptr += 4;
|
||||
memcpy(ptr, &type, 4); ptr += 4;
|
||||
*(unsigned int *)(ptr) = __size_pixels; ptr += 4;
|
||||
stream->readback(pixels, __size_pixels);
|
||||
}
|
||||
|
||||
int rcUpdateColorBuffer_enc(void *self , uint32_t colorbuffer, GLint x, GLint y, GLint width, GLint height, GLenum format, GLenum type, void* pixels)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
IOStream *stream = ctx->m_stream;
|
||||
|
||||
const unsigned int __size_pixels = (((glUtilsPixelBitSize(format, type) * width) >> 3) * height);
|
||||
unsigned char *ptr;
|
||||
const size_t packetSize = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_pixels + 1*4;
|
||||
ptr = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
|
||||
int tmp = OP_rcUpdateColorBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
|
||||
memcpy(ptr, &packetSize, 4); ptr += 4;
|
||||
|
||||
memcpy(ptr, &colorbuffer, 4); ptr += 4;
|
||||
memcpy(ptr, &x, 4); ptr += 4;
|
||||
memcpy(ptr, &y, 4); ptr += 4;
|
||||
memcpy(ptr, &width, 4); ptr += 4;
|
||||
memcpy(ptr, &height, 4); ptr += 4;
|
||||
memcpy(ptr, &format, 4); ptr += 4;
|
||||
memcpy(ptr, &type, 4); ptr += 4;
|
||||
stream->flush();
|
||||
stream->writeFully(&__size_pixels,4);
|
||||
stream->writeFully(pixels, __size_pixels);
|
||||
|
||||
int retval;
|
||||
stream->readback(&retval, 4);
|
||||
return retval;
|
||||
}
|
||||
|
||||
renderControl_encoder_context_t::renderControl_encoder_context_t(IOStream *stream)
|
||||
{
|
||||
m_stream = stream;
|
||||
|
||||
set_rcGetRendererVersion(rcGetRendererVersion_enc);
|
||||
set_rcGetEGLVersion(rcGetEGLVersion_enc);
|
||||
set_rcQueryEGLString(rcQueryEGLString_enc);
|
||||
set_rcGetGLString(rcGetGLString_enc);
|
||||
set_rcGetNumConfigs(rcGetNumConfigs_enc);
|
||||
set_rcGetConfigs(rcGetConfigs_enc);
|
||||
set_rcChooseConfig(rcChooseConfig_enc);
|
||||
set_rcGetFBParam(rcGetFBParam_enc);
|
||||
set_rcCreateContext(rcCreateContext_enc);
|
||||
set_rcDestroyContext(rcDestroyContext_enc);
|
||||
set_rcCreateWindowSurface(rcCreateWindowSurface_enc);
|
||||
set_rcDestroyWindowSurface(rcDestroyWindowSurface_enc);
|
||||
set_rcCreateColorBuffer(rcCreateColorBuffer_enc);
|
||||
set_rcOpenColorBuffer(rcOpenColorBuffer_enc);
|
||||
set_rcCloseColorBuffer(rcCloseColorBuffer_enc);
|
||||
set_rcSetWindowColorBuffer(rcSetWindowColorBuffer_enc);
|
||||
set_rcFlushWindowColorBuffer(rcFlushWindowColorBuffer_enc);
|
||||
set_rcMakeCurrent(rcMakeCurrent_enc);
|
||||
set_rcFBPost(rcFBPost_enc);
|
||||
set_rcFBSetSwapInterval(rcFBSetSwapInterval_enc);
|
||||
set_rcBindTexture(rcBindTexture_enc);
|
||||
set_rcBindRenderbuffer(rcBindRenderbuffer_enc);
|
||||
set_rcColorBufferCacheFlush(rcColorBufferCacheFlush_enc);
|
||||
set_rcReadColorBuffer(rcReadColorBuffer_enc);
|
||||
set_rcUpdateColorBuffer(rcUpdateColorBuffer_enc);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user