mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Tarted-up the openGL demo, and made the iOS demo the same as the normal one. Changed the opengl module to include gl.h automatically, so that your app doesn't need to include it.
This commit is contained in:
parent
02494168e6
commit
6b94c7598d
5 changed files with 268 additions and 171 deletions
|
|
@ -43,8 +43,6 @@
|
|||
//==============================================================================
|
||||
#if JUCE_IOS
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#include <OpenGLES/ES1/gl.h>
|
||||
#include <OpenGLES/ES1/glext.h>
|
||||
|
||||
//==============================================================================
|
||||
#elif JUCE_WINDOWS
|
||||
|
|
@ -62,8 +60,6 @@
|
|||
#pragma comment(lib, "imm32.lib")
|
||||
#endif
|
||||
|
||||
#include <gl/gl.h>
|
||||
|
||||
#if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
|
||||
#pragma comment(lib, "OpenGL32.Lib")
|
||||
#pragma comment(lib, "GlU32.Lib")
|
||||
|
|
|
|||
|
|
@ -29,10 +29,47 @@
|
|||
#include "../juce_gui_extra/juce_gui_extra.h"
|
||||
|
||||
#undef JUCE_OPENGL
|
||||
|
||||
#if ! JUCE_ANDROID
|
||||
#define JUCE_OPENGL 1
|
||||
#endif
|
||||
|
||||
#if JUCE_IOS || JUCE_ANDROID
|
||||
#define JUCE_OPENGL_ES 1
|
||||
#endif
|
||||
|
||||
#if JUCE_WINDOWS
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY __stdcall
|
||||
#define CLEAR_TEMP_APIENTRY 1
|
||||
#endif
|
||||
#ifndef WINGDIAPI
|
||||
#define WINGDIAPI __declspec(dllimport)
|
||||
#define CLEAR_TEMP_WINGDIAPI 1
|
||||
#endif
|
||||
#include <gl/gl.h>
|
||||
#ifdef CLEAR_TEMP_WINGDIAPI
|
||||
#undef WINGDIAPI
|
||||
#undef CLEAR_TEMP_WINGDIAPI
|
||||
#endif
|
||||
#ifdef CLEAR_TEMP_APIENTRY
|
||||
#undef APIENTRY
|
||||
#undef CLEAR_TEMP_APIENTRY
|
||||
#endif
|
||||
#elif JUCE_LINUX
|
||||
#include <GL/gl.h>
|
||||
#undef KeyPress
|
||||
#elif JUCE_IOS
|
||||
#include <OpenGLES/ES1/gl.h>
|
||||
#include <OpenGLES/ES1/glext.h>
|
||||
#elif JUCE_MAC
|
||||
#include <OpenGL/gl.h>
|
||||
#endif
|
||||
|
||||
#ifndef GL_BGRA_EXT
|
||||
#define GL_BGRA_EXT 0x80e1
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
BEGIN_JUCE_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -117,8 +117,10 @@ public:
|
|||
|
||||
void updateWindowPosition (const Rectangle<int>& bounds)
|
||||
{
|
||||
// For some strange reason, the view seems to fail unless its width is a multiple of 8...
|
||||
view.frame = CGRectMake ((CGFloat) bounds.getX(), (CGFloat) bounds.getY(),
|
||||
(CGFloat) bounds.getWidth(), (CGFloat) bounds.getHeight());
|
||||
(CGFloat) (bounds.getWidth() & ~7),
|
||||
(CGFloat) bounds.getHeight());
|
||||
|
||||
if (lastWidth != bounds.getWidth() || lastHeight != bounds.getHeight())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue