Browse Source

tags/2021-05-28
jules 18 years ago
parent
commit
6d6a042e00
13 changed files with 73 additions and 29 deletions
  1. +2
    -2
      build/linux/platform_specific_code/juce_linux_Threads.cpp
  2. +2
    -2
      build/macosx/platform_specific_code/juce_mac_Threads.cpp
  3. +3
    -3
      build/macosx/platform_specific_code/juce_mac_Windowing.cpp
  4. +6
    -4
      build/win32/platform_specific_code/juce_win32_SystemStats.cpp
  5. +2
    -2
      build/win32/platform_specific_code/juce_win32_Threads.cpp
  6. +26
    -0
      src/juce_appframework/gui/components/special/juce_OpenGLComponent.cpp
  7. +10
    -2
      src/juce_appframework/gui/components/special/juce_OpenGLComponent.h
  8. +8
    -1
      src/juce_core/basics/juce_PlatformDefs.h
  9. +0
    -7
      src/juce_core/basics/juce_StandardHeader.h
  10. +9
    -1
      src/juce_core/io/files/juce_File.cpp
  11. +2
    -2
      src/juce_core/io/streams/zlib/zlib.h
  12. +2
    -2
      src/juce_core/io/streams/zlib/zutil.c
  13. +1
    -1
      src/juce_core/threads/juce_Process.h

+ 2
- 2
build/linux/platform_specific_code/juce_linux_Threads.cpp View File

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


+ 2
- 2
build/macosx/platform_specific_code/juce_mac_Threads.cpp 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; static char testResult = 0;


@@ -240,7 +240,7 @@ bool juce_isRunningUnderDebugger() throw()
return testResult > 0; return testResult > 0;
} }


bool Process::isRunningUnderDebugger() throw()
bool JUCE_CALLTYPE Process::isRunningUnderDebugger() throw()
{ {
return juce_isRunningUnderDebugger(); return juce_isRunningUnderDebugger();
} }


+ 3
- 3
build/macosx/platform_specific_code/juce_mac_Windowing.cpp View File

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


+ 6
- 4
build/win32/platform_specific_code/juce_win32_SystemStats.cpp View File

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


+ 2
- 2
build/win32/platform_specific_code/juce_win32_Threads.cpp View File

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


+ 26
- 0
src/juce_appframework/gui/components/special/juce_OpenGLComponent.cpp View File

@@ -68,6 +68,32 @@ bool OpenGLPixelFormat::operator== (const OpenGLPixelFormat& other) const throw(
return memcmp (this, &other, sizeof (other)) == 0; 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 class OpenGLComponentWatcher : public ComponentMovementWatcher


+ 10
- 2
src/juce_appframework/gui/components/special/juce_OpenGLComponent.h View File

@@ -101,7 +101,7 @@ class OpenGLContext
public: public:
//============================================================================== //==============================================================================
/** Destructor. */ /** Destructor. */
virtual ~OpenGLContext() {}
virtual ~OpenGLContext();
//============================================================================== //==============================================================================
/** Makes this context the currently active one. */ /** Makes this context the currently active one. */
@@ -162,11 +162,19 @@ public:
const OpenGLPixelFormat& pixelFormat, const OpenGLPixelFormat& pixelFormat,
const OpenGLContext* const contextToShareWith); 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 juce_UseDebuggingNewOperator
protected: protected:
OpenGLContext() throw() {};
OpenGLContext() throw();
}; };


+ 8
- 1
src/juce_core/basics/juce_PlatformDefs.h View File

@@ -155,6 +155,13 @@
#error unknown compiler #error unknown compiler
#endif #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 // Debugging and assertion macros
@@ -191,7 +198,7 @@
// Assertions.. // Assertions..
BEGIN_JUCE_NAMESPACE BEGIN_JUCE_NAMESPACE
extern bool juce_isRunningUnderDebugger() throw();
extern bool JUCE_CALLTYPE juce_isRunningUnderDebugger() throw();
END_JUCE_NAMESPACE END_JUCE_NAMESPACE
#if JUCE_MSVC || DOXYGEN #if JUCE_MSVC || DOXYGEN


+ 0
- 7
src/juce_core/basics/juce_StandardHeader.h View File

@@ -118,13 +118,6 @@
#define JUCE_API #define JUCE_API
#endif #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. */ /** This macro is added to all juce public function declarations. */
#define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE #define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE


+ 9
- 1
src/juce_core/io/files/juce_File.cpp View File

@@ -1065,7 +1065,15 @@ const String File::getRelativePathFrom (const File& dir) const throw()
while (commonBitLength > 0 && thisPath [commonBitLength - 1] != File::separator) while (commonBitLength > 0 && thisPath [commonBitLength - 1] != File::separator)
--commonBitLength; --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; return fullPath;
thisPath = thisPath.substring (commonBitLength); thisPath = thisPath.substring (commonBitLength);


+ 2
- 2
src/juce_core/io/streams/zlib/zlib.h View File

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


+ 2
- 2
src/juce_core/io/streams/zlib/zutil.c View File

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


+ 1
- 1
src/juce_core/threads/juce_Process.h View File

@@ -96,7 +96,7 @@ public:
//============================================================================== //==============================================================================
/** Returns true if this process is being hosted by a debugger. /** 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. /** Loads a dynamically-linked library into the process's address space.


Loading…
Cancel
Save