Smoke test on macos now compiles
This commit is contained in:
@@ -20,7 +20,7 @@ void KRContext::destroyDeviceContexts()
|
||||
gRenderContext = nil;
|
||||
}
|
||||
|
||||
void KRContext::createDeviceContexts()
|
||||
void createGLDeviceContexts()
|
||||
{
|
||||
if(gRenderContext == nil) {
|
||||
|
||||
@@ -63,20 +63,20 @@ void KRContext::createDeviceContexts()
|
||||
|
||||
void KRContext::activateStreamerContext()
|
||||
{
|
||||
createDeviceContexts();
|
||||
createGLDeviceContexts();
|
||||
[gStreamerContext makeCurrentContext];
|
||||
}
|
||||
|
||||
void KRContext::activateRenderContext()
|
||||
{
|
||||
createDeviceContexts();
|
||||
createGLDeviceContexts();
|
||||
[gRenderContext update];
|
||||
[gRenderContext makeCurrentContext];
|
||||
}
|
||||
|
||||
void KRContext::attachToView(void *view)
|
||||
{
|
||||
createDeviceContexts();
|
||||
createGLDeviceContexts();
|
||||
NSView *v = (NSView *)view;
|
||||
[gRenderContext setView: v];
|
||||
[gRenderContext update];
|
||||
|
||||
@@ -4,10 +4,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if (WIN32)
|
||||
add_executable(kraken_cube WIN32 main.cpp)
|
||||
add_executable(kraken_cube WIN32 main_win.cpp)
|
||||
add_compile_definitions(UNICODE)
|
||||
else(WIN32)
|
||||
add_executable(kraken_cube main.cpp)
|
||||
add_executable(kraken_cube main_macos.mm)
|
||||
set(CMAKE_CXX_COMPILER "clang++")
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
33
tests/smoke/hello_cube/main_macos.mm
Normal file
33
tests/smoke/hello_cube/main_macos.mm
Normal file
@@ -0,0 +1,33 @@
|
||||
#import "Cocoa/Cocoa.h"
|
||||
#include "kraken.h"
|
||||
|
||||
using namespace kraken;
|
||||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
//
|
||||
// Create a window:
|
||||
//
|
||||
|
||||
// Style flags:
|
||||
NSUInteger windowStyle = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
|
||||
|
||||
NSRect windowRect = NSMakeRect(0, 0, 640, 480);
|
||||
NSWindow * window = [[NSWindow alloc] initWithContentRect:windowRect
|
||||
styleMask:windowStyle
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
[window autorelease];
|
||||
|
||||
// Window controller:
|
||||
NSWindowController * windowController = [[NSWindowController alloc] initWithWindow:window];
|
||||
[windowController autorelease];
|
||||
|
||||
[window orderFrontRegardless];
|
||||
[NSApp run];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user