- use expectations

- improved gibbs sampling
- LayerArray is template class

git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@18 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2014-10-06 17:08:50 +00:00
parent f62f1283f8
commit fc758b853a
122 changed files with 1053 additions and 1149 deletions
@@ -22,7 +22,7 @@
==============================================================================
*/
extern ComponentPeer* createNonRepaintingEmbeddedWindowsPeer (Component&, void* parent);
extern ComponentPeer* createNonRepaintingEmbeddedWindowsPeer (Component*, void* parent);
//==============================================================================
class OpenGLContext::NativeContext
@@ -33,9 +33,7 @@ public:
void* contextToShareWith,
bool /*useMultisampling*/,
OpenGLVersion)
: context (nullptr)
{
dummyComponent = new DummyComponent (*this);
createNativeWindow (component);
PIXELFORMATDESCRIPTOR pfd;
@@ -84,8 +82,8 @@ public:
releaseDC();
}
void initialiseOnRenderThread (OpenGLContext& c) { context = &c; }
void shutdownOnRenderThread() { deactivateCurrentContext(); context = nullptr; }
void initialiseOnRenderThread (OpenGLContext&) {}
void shutdownOnRenderThread() { deactivateCurrentContext(); }
static void deactivateCurrentContext() { wglMakeCurrent (0, 0); }
bool makeActive() const noexcept { return isActive() || wglMakeCurrent (dc, renderContext) != FALSE; }
@@ -116,30 +114,13 @@ public:
void* getRawContext() const noexcept { return renderContext; }
unsigned int getFrameBufferID() const noexcept { return 0; }
void triggerRepaint()
{
if (context != nullptr)
context->triggerRepaint();
}
struct Locker { Locker (NativeContext&) {} };
private:
struct DummyComponent : public Component
{
DummyComponent (NativeContext& c) : context (c) {}
// The windowing code will call this when a paint callback happens
void handleCommandMessage (int) override { context.triggerRepaint(); }
NativeContext& context;
};
ScopedPointer<DummyComponent> dummyComponent;
Component dummyComponent;
ScopedPointer<ComponentPeer> nativeWindow;
HGLRC renderContext;
HDC dc;
OpenGLContext* context;
#define JUCE_DECLARE_WGL_EXTENSION_FUNCTION(name, returnType, params) \
typedef returnType (__stdcall *type_ ## name) params; type_ ## name name;
@@ -161,7 +142,7 @@ private:
void createNativeWindow (Component& component)
{
Component* topComp = component.getTopLevelComponent();
nativeWindow = createNonRepaintingEmbeddedWindowsPeer (*dummyComponent, topComp->getWindowHandle());
nativeWindow = createNonRepaintingEmbeddedWindowsPeer (&dummyComponent, topComp->getWindowHandle());
if (ComponentPeer* peer = topComp->getPeer())
updateWindowPosition (peer->getAreaCoveredBy (component));