[DEV] try a basic windows on cocoa

This commit is contained in:
Edouard DUPIN 2013-04-04 01:54:38 +02:00
parent ca352c94d9
commit c4d156d462
9 changed files with 39 additions and 30 deletions

2
build

@ -1 +1 @@
Subproject commit 7674fedbe9379979ed6ac2de0f035690b3071fe8 Subproject commit 0a3b7ca530db3ff61b399b55f7e94bdf3928dcd6

@ -29,12 +29,7 @@ endif
LOCAL_C_INCLUDES := LOCAL_C_INCLUDES :=
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_LDLIBS := -framework OpenGL LOCAL_EXPORT_LDLIBS := -I /usr/include/GNUstep/ -fconstant-string-class=NSConstantString -framework Cocoa -framework QuartzCore -framework OpenGL -framework AppKit
#http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Introduction
# needed package on linux : libgl1-mesa-dev libglew1.5-dev
LOCAL_CFLAGS := -Wno-write-strings \ LOCAL_CFLAGS := -Wno-write-strings \
-DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG)-$(BUILD_DIRECTORY_MODE)\"" \ -DEWOL_VERSION_TAG_NAME="\"$(LOCAL_VERSION_TAG)-$(BUILD_DIRECTORY_MODE)\"" \

@ -129,25 +129,25 @@ typedef struct {
static correspondenceTable_ts basicFlag[] = { static correspondenceTable_ts basicFlag[] = {
{(uint32_t)ewol::openGL::FLAG_BLEND, GL_BLEND}, {(uint32_t)ewol::openGL::FLAG_BLEND, GL_BLEND},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_CLIP_DISTANCE_I, GL_CLIP_DISTANCE0}, {(uint32_t)ewol::openGL::FLAG_CLIP_DISTANCE_I, GL_CLIP_DISTANCE0},
{(uint32_t)ewol::openGL::FLAG_COLOR_LOGIC_OP, GL_COLOR_LOGIC_OP}, {(uint32_t)ewol::openGL::FLAG_COLOR_LOGIC_OP, GL_COLOR_LOGIC_OP},
#endif #endif
{(uint32_t)ewol::openGL::FLAG_CULL_FACE, GL_CULL_FACE}, {(uint32_t)ewol::openGL::FLAG_CULL_FACE, GL_CULL_FACE},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_DEBUG_OUTPUT, GL_DEBUG_OUTPUT}, {(uint32_t)ewol::openGL::FLAG_DEBUG_OUTPUT, GL_DEBUG_OUTPUT},
{(uint32_t)ewol::openGL::FLAG_DEBUG_OUTPUT_SYNCHRONOUS, GL_DEBUG_OUTPUT_SYNCHRONOUS}, {(uint32_t)ewol::openGL::FLAG_DEBUG_OUTPUT_SYNCHRONOUS, GL_DEBUG_OUTPUT_SYNCHRONOUS},
{(uint32_t)ewol::openGL::FLAG_DEPTH_CLAMP, GL_DEPTH_CLAMP}, {(uint32_t)ewol::openGL::FLAG_DEPTH_CLAMP, GL_DEPTH_CLAMP},
#endif #endif
{(uint32_t)ewol::openGL::FLAG_DEPTH_TEST, GL_DEPTH_TEST}, {(uint32_t)ewol::openGL::FLAG_DEPTH_TEST, GL_DEPTH_TEST},
{(uint32_t)ewol::openGL::FLAG_DITHER, GL_DITHER}, {(uint32_t)ewol::openGL::FLAG_DITHER, GL_DITHER},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_FRAMEBUFFER_SRGB, GL_FRAMEBUFFER_SRGB}, {(uint32_t)ewol::openGL::FLAG_FRAMEBUFFER_SRGB, GL_FRAMEBUFFER_SRGB},
{(uint32_t)ewol::openGL::FLAG_LINE_SMOOTH, GL_LINE_SMOOTH}, {(uint32_t)ewol::openGL::FLAG_LINE_SMOOTH, GL_LINE_SMOOTH},
{(uint32_t)ewol::openGL::FLAG_MULTISAMPLE, GL_MULTISAMPLE}, {(uint32_t)ewol::openGL::FLAG_MULTISAMPLE, GL_MULTISAMPLE},
#endif #endif
{(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_FILL}, {(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_FILL},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_LINE, GL_POLYGON_OFFSET_LINE}, {(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_LINE, GL_POLYGON_OFFSET_LINE},
{(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_POINT, GL_POLYGON_OFFSET_POINT}, {(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_POINT, GL_POLYGON_OFFSET_POINT},
{(uint32_t)ewol::openGL::FLAG_POLYGON_SMOOTH, GL_POLYGON_SMOOTH}, {(uint32_t)ewol::openGL::FLAG_POLYGON_SMOOTH, GL_POLYGON_SMOOTH},
@ -155,21 +155,21 @@ static correspondenceTable_ts basicFlag[] = {
{(uint32_t)ewol::openGL::FLAG_PRIMITIVE_RESTART_FIXED_INDEX, GL_PRIMITIVE_RESTART_FIXED_INDEX}, {(uint32_t)ewol::openGL::FLAG_PRIMITIVE_RESTART_FIXED_INDEX, GL_PRIMITIVE_RESTART_FIXED_INDEX},
#endif #endif
{(uint32_t)ewol::openGL::FLAG_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_ALPHA_TO_COVERAGE}, {(uint32_t)ewol::openGL::FLAG_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_ALPHA_TO_COVERAGE},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_ALPHA_TO_ONE}, {(uint32_t)ewol::openGL::FLAG_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_ALPHA_TO_ONE},
#endif #endif
{(uint32_t)ewol::openGL::FLAG_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE}, {(uint32_t)ewol::openGL::FLAG_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_SAMPLE_SHADING, GL_SAMPLE_SHADING}, {(uint32_t)ewol::openGL::FLAG_SAMPLE_SHADING, GL_SAMPLE_SHADING},
{(uint32_t)ewol::openGL::FLAG_SAMPLE_MASK, GL_SAMPLE_MASK}, {(uint32_t)ewol::openGL::FLAG_SAMPLE_MASK, GL_SAMPLE_MASK},
#endif #endif
{(uint32_t)ewol::openGL::FLAG_SCISSOR_TEST, GL_SCISSOR_TEST}, {(uint32_t)ewol::openGL::FLAG_SCISSOR_TEST, GL_SCISSOR_TEST},
{(uint32_t)ewol::openGL::FLAG_STENCIL_TEST, GL_STENCIL_TEST}, {(uint32_t)ewol::openGL::FLAG_STENCIL_TEST, GL_STENCIL_TEST},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_PROGRAM_POINT_SIZE, GL_PROGRAM_POINT_SIZE}, {(uint32_t)ewol::openGL::FLAG_PROGRAM_POINT_SIZE, GL_PROGRAM_POINT_SIZE},
#endif #endif
{(uint32_t)ewol::openGL::FLAG_TEXTURE_2D, GL_TEXTURE_2D}, {(uint32_t)ewol::openGL::FLAG_TEXTURE_2D, GL_TEXTURE_2D},
#ifndef __TARGET_OS__Android #if !(defined(__TARGET_OS__Android) || defined(__TARGET_OS__MacOs))
{(uint32_t)ewol::openGL::FLAG_ALPHA_TEST, GL_ALPHA_TEST}, {(uint32_t)ewol::openGL::FLAG_ALPHA_TEST, GL_ALPHA_TEST},
{(uint32_t)ewol::openGL::FLAG_FOG, GL_FOG} {(uint32_t)ewol::openGL::FLAG_FOG, GL_FOG}
#endif #endif

@ -1,10 +1,8 @@
#import <UIKit/UIKit.h> #import <Cocoa/Cocoa.h>
@interface MacOsAppDelegate : NSObject <UIApplicationDelegate> { @interface MacOsAppDelegate : NSObject <NSApplicationDelegate>
} @property (assign) IBOutlet NSWindow *window;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end @end

@ -3,6 +3,20 @@
#import <ewol/renderer/os/gui.MacOs.AppDelegate.h> #import <ewol/renderer/os/gui.MacOs.AppDelegate.h>
#import <ewol/renderer/os/gui.MacOs.OpenglView.h> #import <ewol/renderer/os/gui.MacOs.OpenglView.h>
@implementation MacOsAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
}
@end
#if 0
@implementation MacOsAppDelegate @implementation MacOsAppDelegate
@ -63,3 +77,4 @@
} }
@end @end
#endif

@ -2,8 +2,7 @@
#ifndef __MM_INTERFACE_H__ #ifndef __MM_INTERFACE_H__
#define __MM_INTERFACE_H__ #define __MM_INTERFACE_H__
int mm_main(int argc, const char *argv[]);
int mm_main(int argc, char *argv[]);
#endif #endif

@ -2,13 +2,11 @@
#import <UIKit/UIKit.h> #import <Cocoa/Cocoa.h>
#import <ewol/renderer/os/gui.MacOs.AppDelegate.h>
int mm_main(int argc, char *argv[]) int mm_main(int argc, const char *argv[])
{ {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; return NSApplicationMain(argc, (const char **)argv);
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
} }

@ -1,9 +1,9 @@
#import <UIKit/UIKit.h> #import <Cocoa/Cocoa.h>
#if 0
#import <OpenGLES/ES2/gl.h> #import <OpenGLES/ES2/gl.h>
#import <QuartzCore/QuartzCore.h> #import <QuartzCore/QuartzCore.h>
@interface OpenglView : UIView { @interface OpenglView : UIView {
EAGLContext *mimContext; EAGLContext *mimContext;
@ -14,3 +14,4 @@
} }
- (void)drawView; - (void)drawView;
@end @end
#endif

@ -2,6 +2,7 @@
#import <ewol/renderer/os/gui.MacOs.OpenglView.h> #import <ewol/renderer/os/gui.MacOs.OpenglView.h>
#if 0
@implementation OpenglView @implementation OpenglView
@ -65,3 +66,5 @@
} }
@end @end
#endif