Skip to content

Instantly share code, notes, and snippets.

1. The texture target needs to be GLES20.GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D, e.g. in the glBindTexture calls and glTexParameteri calls.
2. In the fragment shader define a requirement to use the extension:
#extension GL_OES_EGL_image_external : require
3. For the texture sampler used in the fragment shader, use samplerExternalOES instead of sampler2D.
Everything below here is all in the C code, no more Java.
4. In the C code, use glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage) to specify where the data is, instead of using glTexImage2D family of functions.
@zjx20
zjx20 / alipay.h
Created August 13, 2016 06:55
alipay in c++
#ifndef __ALIPAY_H__
#define __ALIPAY_H__
#include "base64/base64.h"
#include <curl/curl.h>
#include <map>
#include <openssl/bio.h>
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which