1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +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

@ -341,7 +341,7 @@ void Process::terminate()
exit (0);
}
bool juce_isRunningUnderDebugger() throw()
bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw()
{
static char testResult = 0;
@ -356,7 +356,7 @@ bool juce_isRunningUnderDebugger() throw()
return testResult > 0;
}
bool Process::isRunningUnderDebugger() throw()
bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw()
{
return juce_isRunningUnderDebugger();
}

View file

@ -225,7 +225,7 @@ void JUCE_CALLTYPE Thread::sleep (int millisecs) throw()
//==============================================================================
bool juce_isRunningUnderDebugger() throw()
bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw()
{
static char testResult = 0;
@ -240,7 +240,7 @@ bool juce_isRunningUnderDebugger() throw()
return testResult > 0;
}
bool Process::isRunningUnderDebugger() throw()
bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw()
{
return juce_isRunningUnderDebugger();
}

View file

@ -650,7 +650,7 @@ public:
{
ProcessSerialNumber psn;
GetCurrentProcess (&psn);
SetFrontProcess (&psn);
SetFrontProcessWithOptions (&psn, kSetFrontProcessFrontWindowOnly);
}
if (IsValidWindowPtr (windowRef))
@ -1231,7 +1231,7 @@ public:
{
ProcessSerialNumber psn;
GetCurrentProcess (&psn);
SetFrontProcess (&psn);
SetFrontProcessWithOptions (&psn, kSetFrontProcessFrontWindowOnly);
toFront (true);
}
@ -3403,7 +3403,7 @@ public:
bool setSwapInterval (const int numFramesPerSwap)
{
return aglSetInteger (renderContext, AGL_SWAP_INTERVAL, &numFramesPerSwap);
return aglSetInteger (renderContext, AGL_SWAP_INTERVAL, (const GLint*) &numFramesPerSwap);
}
int getSwapInterval() const

View file

@ -89,8 +89,6 @@ void Logger::outputDebugPrintf (const tchar* format, ...) throw()
static int64 hiResTicksPerSecond;
static double hiResTicksScaleFactor;
static SYSTEM_INFO systemInfo;
//==============================================================================
#if JUCE_USE_INTRINSICS
@ -276,8 +274,6 @@ void SystemStats::initialiseStats() throw()
String s (SystemStats::getJUCEVersion());
GetSystemInfo (&systemInfo);
#ifdef JUCE_DEBUG
const MMRESULT res = timeBeginPeriod (1);
jassert (res == TIMERR_NOERROR);
@ -362,6 +358,9 @@ int SystemStats::getMemorySizeInMegabytes() throw()
int SystemStats::getNumCpus() throw()
{
SYSTEM_INFO systemInfo;
GetSystemInfo (&systemInfo);
return systemInfo.dwNumberOfProcessors;
}
@ -488,6 +487,9 @@ bool Time::setSystemTimeToThisTime() const throw()
int SystemStats::getPageSize() throw()
{
SYSTEM_INFO systemInfo;
GetSystemInfo (&systemInfo);
return systemInfo.dwPageSize;
}

View file

@ -299,12 +299,12 @@ void Process::setPriority (ProcessPriority prior)
}
}
bool juce_isRunningUnderDebugger() throw()
bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw()
{
return IsDebuggerPresent() != FALSE;
}
bool Process::isRunningUnderDebugger() throw()
bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw()
{
return juce_isRunningUnderDebugger();
}

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.