Code Monkey home page Code Monkey logo

basicwindows's Introduction

Basic Windows

What is this?

TODO

macOS

Creating a basic window in a console application.

#import <Cocoa/Cocoa.h>
#import "BasicWindow.h"

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        CGFloat x, y, width, height;
        // Create your own NSViewController.
        NSViewController *vc = [[NSViewController alloc] initWithNibName:nil bundle:nil];
        IBasicWindowDelegateCallbacks window_delegate_cbs = {0};
        BasicWindowDelegate *window_delegate = [[BasicWindowDelegate alloc] initWithCallbacks:&window_delegate_cbs];
        NSWindow *window = [BasicWindowFactory windowWithContentViewController:vc windowDelegate:window_delegate];
        [window setFrame:NSMakeRect(x, y, width, height) display:YES];
        NSWindowController *window_controller = [[NSWindowController alloc] initWithWindow:window];
        IBasicApplicationDelegateCallbacks app_delegate_cbs = {0};
        app_delegate_cbs.user_data = (__bridge void*)window_controller;
        app_delegate_cbs.application_did_finish_launching = [](NSNotification * _Nullable notification, void * _Nullable user_data) {
            NSWindowController *window_controller = (__bridge NSWindowController*)user_data;
            [window_controller showWindow:nil];
        };
        BasicApplicationDelegate *app_delegate = [[BasicApplicationDelegate alloc] initWithCallbacks:&app_delegate_cbs];
        [[NSApplication sharedApplication] setDelegate:app_delegate];
        [[NSApplication sharedApplication] run];
    }
    return 0;
}

Creating a basic Metal view

TODO

Windows

Creating a basic window

TODO

Creating a basic DX12 window

TODO

Creating a basic Vulkan window

TODO

basicwindows's People

Contributors

ctoliver avatar

Stargazers

NOYB avatar Christian Helmich avatar

Watchers

Christian Helmich avatar  avatar

Forkers

godratio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.