Browse Source

Android GL work.

tags/2021-05-28
jules 13 years ago
parent
commit
2bfa580254
6 changed files with 21 additions and 7 deletions
  1. +2
    -0
      extras/JuceDemo/Builds/Android/src/com/juce/JuceDemo.java
  2. +2
    -2
      modules/juce_core/maths/juce_MathsFunctions.h
  3. +2
    -0
      modules/juce_core/native/java/JuceAppActivity.java
  4. +12
    -3
      modules/juce_opengl/juce_opengl.cpp
  5. +2
    -1
      modules/juce_opengl/juce_opengl.h
  6. +1
    -1
      modules/juce_opengl/native/juce_MissingGLDefinitions.h

+ 2
- 0
extras/JuceDemo/Builds/Android/src/com/juce/JuceDemo.java View File

@@ -29,6 +29,8 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.*;
import android.graphics.*;


+ 2
- 2
modules/juce_core/maths/juce_MathsFunctions.h View File

@@ -140,7 +140,7 @@ const Type findMinimum (const Type* data, int numValues)
return result;
}
/** Scans an array of values, returning the minimum value that it contains. */
/** Scans an array of values, returning the maximum value that it contains. */
template <typename Type>
const Type findMaximum (const Type* values, int numValues)
{
@@ -152,7 +152,7 @@ const Type findMaximum (const Type* values, int numValues)
while (--numValues > 0) // (> 0 rather than >= 0 because we've already taken the first sample)
{
const Type& v = *values++;
if (result > v) result = v;
if (result < v) result = v;
}
return result;


+ 2
- 0
modules/juce_core/native/java/JuceAppActivity.java View File

@@ -29,6 +29,8 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.*;
import android.graphics.*;


+ 12
- 3
modules/juce_opengl/juce_opengl.cpp View File

@@ -117,7 +117,6 @@
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES 1
#endif
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#endif
@@ -131,14 +130,24 @@ namespace juce
void OpenGLExtensionFunctions::initialise()
{
#if JUCE_WINDOWS || JUCE_LINUX
#define JUCE_INIT_GL_FUNCTION(name, returnType, params, callparams) name = (type_ ## name) OpenGLHelpers::getExtensionFunction (#name);
#define JUCE_INIT_GL_FUNCTION(name, returnType, params, callparams) \
name = (type_ ## name) OpenGLHelpers::getExtensionFunction (#name);
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_INIT_GL_FUNCTION)
#undef JUCE_INIT_GL_FUNCTION
#endif
}
struct XYZ
{
XYZ (const char* name) { DBG (name); }
~XYZ() { DBG ("out"); }
};
#if JUCE_OPENGL_ES
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) inline returnType OpenGLExtensionFunctions::name params { return ::name callparams; }
#define JUCE_DECLARE_GL_FUNCTION(name, returnType, params, callparams) \
inline returnType OpenGLExtensionFunctions::name params { XYZ xx (#name); return ::name callparams; }
JUCE_GL_EXTENSION_FUNCTIONS (JUCE_DECLARE_GL_FUNCTION)
#undef JUCE_DECLARE_GL_FUNCTION
#endif


+ 2
- 1
modules/juce_opengl/juce_opengl.h View File

@@ -33,6 +33,7 @@
#if JUCE_IOS || JUCE_ANDROID
#define JUCE_OPENGL_ES 1
#define JUCE_USE_OPENGL_FIXED_FUNCTION 0
#endif
#if JUCE_WINDOWS
@@ -63,7 +64,7 @@
#include <OpenGL/gl.h>
#include "OpenGL/glext.h"
#elif JUCE_ANDROID
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#endif
#if (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) && ! defined (JUCE_USE_OPENGL_SHADERS)


+ 1
- 1
modules/juce_opengl/native/juce_MissingGLDefinitions.h View File

@@ -50,7 +50,7 @@ namespace
#endif
#ifndef GL_DEPTH24_STENCIL8
#define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
enum { GL_DEPTH24_STENCIL8 = 0x88F0 };
#endif
#if JUCE_WINDOWS


Loading…
Cancel
Save