1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00
This commit is contained in:
jules 2007-09-24 17:49:30 +00:00
parent 7ba402348e
commit 6d6a042e00
13 changed files with 73 additions and 29 deletions

View file

@ -68,6 +68,32 @@ bool OpenGLPixelFormat::operator== (const OpenGLPixelFormat& other) const throw(
return memcmp (this, &other, sizeof (other)) == 0;
}
//==============================================================================
static VoidArray knownContexts;
OpenGLContext::OpenGLContext() throw()
{
knownContexts.add (this);
}
OpenGLContext::~OpenGLContext()
{
knownContexts.removeValue (this);
}
OpenGLContext* OpenGLContext::getCurrentContext() throw()
{
for (int i = knownContexts.size(); --i >= 0;)
{
OpenGLContext* const oglc = (OpenGLContext*) knownContexts.getUnchecked(i);
if (oglc->isActive())
return oglc;
}
return 0;
}
//==============================================================================
class OpenGLComponentWatcher : public ComponentMovementWatcher

View file

@ -101,7 +101,7 @@ class OpenGLContext
public:
//==============================================================================
/** Destructor. */
virtual ~OpenGLContext() {}
virtual ~OpenGLContext();
//==============================================================================
/** Makes this context the currently active one. */
@ -162,11 +162,19 @@ public:
const OpenGLPixelFormat& pixelFormat,
const OpenGLContext* const contextToShareWith);
//==============================================================================
/** Returns the context that's currently in active use by the calling thread.
Returns 0 if there isn't an active context.
*/
static OpenGLContext* getCurrentContext() throw();
//==============================================================================
juce_UseDebuggingNewOperator
protected:
OpenGLContext() throw() {};
OpenGLContext() throw();
};

View file

@ -155,6 +155,13 @@
#error unknown compiler
#endif
/** This macro defines the C calling convention used as the standard for Juce calls. */
#if JUCE_MSVC
#define JUCE_CALLTYPE __stdcall
#else
#define JUCE_CALLTYPE
#endif
//==============================================================================
// Debugging and assertion macros
@ -191,7 +198,7 @@
// Assertions..
BEGIN_JUCE_NAMESPACE
extern bool juce_isRunningUnderDebugger() throw();
extern bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw();
END_JUCE_NAMESPACE
#if JUCE_MSVC || DOXYGEN

View file

@ -118,13 +118,6 @@
#define JUCE_API
#endif
/** This macro defines the C calling convention used as the standard for Juce calls. */
#if JUCE_MSVC
#define JUCE_CALLTYPE __stdcall
#else
#define JUCE_CALLTYPE
#endif
/** This macro is added to all juce public function declarations. */
#define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE

View file

@ -1065,7 +1065,15 @@ const String File::getRelativePathFrom (const File& dir) const throw()
while (commonBitLength > 0 && thisPath [commonBitLength - 1] != File::separator)
--commonBitLength;
if (commonBitLength <= 0)
// if the only common bit is the root, then just return the full path..
#if JUCE_WIN32
if (commonBitLength <= 0
|| (commonBitLength == 1 && thisPath [1] == File::separator)
|| (commonBitLength <= 3 && thisPath [1] == T(':')))
#else
if (commonBitLength <= 0
|| (commonBitLength == 1 && thisPath [1] == File::separator))
#endif
return fullPath;
thisPath = thisPath.substring (commonBitLength);

View file

@ -209,7 +209,7 @@ typedef gz_header FAR *gz_headerp;
/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
//ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is
not compatible with the zlib.h header file used by the application.
@ -954,7 +954,7 @@ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
state was inconsistent.
*/
ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
//ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
/* Return flags indicating compile-time options.
Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:

View file

@ -24,7 +24,7 @@ const char * const z_errmsg[10] = {
""};
const char * ZEXPORT zlibVersion()
/*const char * ZEXPORT zlibVersion()
{
return ZLIB_VERSION;
}
@ -110,7 +110,7 @@ uLong ZEXPORT zlibCompileFlags()
# endif
#endif
return flags;
}
}*/
#ifdef DEBUG

View file

@ -96,7 +96,7 @@ public:
//==============================================================================
/** Returns true if this process is being hosted by a debugger.
*/
static bool isRunningUnderDebugger() throw();
static bool JUCE_CALLTYPE isRunningUnderDebugger() throw();
//==============================================================================
/** Loads a dynamically-linked library into the process's address space.