diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-01-23 15:40:55 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-01-23 15:40:55 +0100 |
commit | 9b431298d0346ce2a181771e9cc78b83c97737f1 (patch) | |
tree | 268d5d29b307bccc1611b4180035e9ccc23edb90 /libmlx/mlx_new_window.h | |
parent | Added back minilibx, added gitignore (diff) | |
download | 42-cub3d-9b431298d0346ce2a181771e9cc78b83c97737f1.tar.gz 42-cub3d-9b431298d0346ce2a181771e9cc78b83c97737f1.tar.bz2 42-cub3d-9b431298d0346ce2a181771e9cc78b83c97737f1.tar.xz 42-cub3d-9b431298d0346ce2a181771e9cc78b83c97737f1.tar.zst 42-cub3d-9b431298d0346ce2a181771e9cc78b83c97737f1.zip |
Renamed minilibx to mlx
Diffstat (limited to 'libmlx/mlx_new_window.h')
-rw-r--r-- | libmlx/mlx_new_window.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/libmlx/mlx_new_window.h b/libmlx/mlx_new_window.h new file mode 100644 index 0000000..d173e61 --- /dev/null +++ b/libmlx/mlx_new_window.h @@ -0,0 +1,57 @@ +// +// mlx_int.h for minilibx +// +// ol@staff.42.fr +// +// include opengl needed before mlx_int.h +// + +#import <Cocoa/Cocoa.h> +#import "mlx_int.h" + +@interface NSWindowEvent : NSWindow +{ + func_t event_funct[MAX_EVENT]; + void *(event_param[MAX_EVENT]); + int keyrepeat; + int keyflag; + int size_x; + int size_y; +} +- (NSWindowEvent *) initWithContentRect:(NSRect)rect styleMask:(NSUInteger)winstyle backing:(NSBackingStoreType)bck defer:(BOOL) dfr; +- (void) setEvent:(int)event andFunc:(func_t)func andParam:(void *)param; +- (void) setKeyRepeat:(int)mode; +- (void) exposeNotification:(NSNotification *)note; +- (void) closeNotification:(NSNotification *)note; +@end + + +@interface MlxWin : NSOpenGLView +{ + NSWindowEvent *win; + NSOpenGLContext *ctx; + glsl_info_t glsl; + int openglwin; + + int size_x; + int size_y; + + int pixel_nb; + GLuint pixel_vbuffer; + GLuint pixel_texture; + unsigned int *pixtexbuff; +} + +- (id) initWithRect: (NSRect)rect andTitle: (NSString *)title pfaAttrs: (NSOpenGLPixelFormatAttribute *)attrs; +- (void) selectGLContext; +- (void) flushGLContext; +- (void) pixelPutColor: (int)color X:(int)x Y:(int)y; +- (void) mlx_gl_draw; +- (void) mlx_gl_draw_img:(mlx_img_list_t *)img andCtx:(mlx_img_ctx_t *)imgctx andX:(int)x andY:(int)y; +- (void) mlx_gl_draw_font:(mlx_img_list_t *)img andCtx:(mlx_img_ctx_t *)imgctx andX:(int)x andY:(int)y andColor:(int)color glyphX:(int)gx glyphY:(int)gy; +- (NSOpenGLContext *) ctx; +- (NSWindowEvent *) win; +- (void) setEvent:(int)event andFunc:(func_t)func andParam:(void *)param; +- (void) setKeyRepeat:(int)mode; +- (void) ctxNeedsUpdate; +@end |