Skip to content
/ gwc Public

reallukee/gwc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

148 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GWC
Graphical Window for Console Apps

License Release Language

🖼️ A C#, C++ and C graphics library written in C#, C++ and C

Banner

Caratteristiche:

  • 🤪 Folle
  • ☠️ Mortale
  • 🔬 Sperimentale
  • 🪄 Inaffidabile
  • 🚀 Ambiziosa
  • 📦 Instabile
  • 🤤 Goduriosa

Architettura

graph TD
  Core["Core Managed<br />(GWC)<br />(GWC.Mono)"]

  subgraph Stack.Native["Stack Native"]
    Native["Wrapper Mixed<br />(GWC.Native)<br />(GWC.Native.Abst)"]

    VC++.API["VC++ API<br />100% Native"]

    VC++.App["Applicazione VC++<br />(C, C++, C++/CLI)"]

    Native --> VC++.API

    VC++.API --> VC++.App
  end

  subgraph Stack..NET["Stack .NET"]
    .NET.API[".NET API<br />100% Managed"]

    .NET.App["Applicazione .NET<br />(C#, Visual Basic, F#)"]

    .NET.API --> .NET.App
  end

  Core --> Native
  Core --> .NET.API
Loading

Approssimativa!

GWC

  • Libreria Core Managed con interfaccia API 100% Managed
  • Scritta in C#
  • Espone l'API .NET

GWC.Mono

  • Libreria Mono Managed con interfaccia API 100% Managed
  • Scritta in C#
  • Espone l'API .NET

GWC.Native

  • Libreria Wrapper Mixed con interfaccia API 100% Native
  • Scritta in C++/CLI, C++ e C
  • Espone l'API VC++

GWC.Native.Abst

  • Libreria Wrapper Mixed con interfaccia API 100% Native
  • Scritta in C++/CLI, C++ e C
  • Espone l'API VC++

Organizzazione

.vscode/             Configurazione Visual Studio Code
assets/              Assets
config/              Config Scripts v1
config2/             Config Scripts v2
docs/                Documentazione
examples/            Esempi
gwc/                 Codice sorgente Core
gwc.dev/             Modalità dev Core
gwc.native/          Codice sorgente Nativo
gwc.native.dev/      Modalità dev Nativo
gwc.native.abst/     Codice sorgente Nativo Abst
gwc.native.abst.dev/ Modalità dev Nativo Abst
scripts/             Scripts v1
scripts2/            Scripts v2
templates/           Template

Esempi

API C

GWC.Native

#include <gwc.h>

int main(int argc, const char* argv[])
{
    render_init();

    WINDOW* window = window_new(800, 600);

    window_open(window);

    if (!window_isInitialized(window))
    {
        window_delete(window);

        render_shutdown();

        return 1;
    }

    bool loop = true;

    while (window_isOpen(window) && loop)
    {
        gKEYS modifiers = gKEYS_NONE;
        gKEYS key = gKEYS_NONE;

        bool keyDown = window_consumeKeyDown(window, &modifiers, &key);

        if (keyDown)
        {
            if (key == gKEYS_ESCAPE)
            {
                loop = false;

                continue;
            }
        }

        window_wait(window, 16);
    }

    if (window_isOpen(window))
    {
        window_close(window);
    }

    window_delete(window);

    render_shutdown();

    return 0;
}

GWC.Native.Abst

#include <gwc.h>

#include <gwc_abst.h>

int main(int argc, const char* argv[])
{
    render_init();
    wndmgr_init();

    WINDOW_ID window = wndmgr_alloc(800, 600, true);

    wndmgr_open();

    if (!wndmgr_isInitialized())
    {
        render_shutdown();
        wndmgr_shutdown();

        return 1;
    }

    bool loop = true;

    while (wndmgr_isOpen() && loop)
    {
        gKEYS modifiers = gKEYS_NONE;
        gKEYS key = gKEYS_NONE;

        bool keyDown = wndmgr_consumeKeyDown(&modifiers, &key);

        if (keyDown)
        {
            if (key == gKEYS_ESCAPE)
            {
                loop = false;

                continue;
            }
        }

        wndmgr_wait(16);
    }

    if (wndmgr_isOpen())
    {
        wndmgr_close();
    }

    render_shutdown();
    wndmgr_shutdown();

    return 0;
}

API C++

GWC.Native

#include <gwc.hpp>

using namespace gwc;

int main(int argc, const char* argv[])
{
    Render::init();

    Window* window = new Window(800, 600);

    window->open();

    if (!window->isInitialized())
    {
        delete window;

        Render::shutdown();

        return 1;
    }

    bool loop = true;

    while (window->isOpen() && loop)
    {
        gKeys modifiers = gKeys::None;
        gKeys key = gKeys::None;

        bool keyDown = window->consumeKeyDown(modifiers, key);

        if (keyDown)
        {
            if (key == gKeys::Escape)
            {
                loop = false;

                continue;
            }
        }

        window->wait(16);
    }

    if (window->isOpen())
    {
        window->close();
    }

    delete window;

    Render::shutdown();

    return 0;
}

GWC.Native.Abst

#include <gwc.hpp>

using namespace gwc;

#include <gwc_abst.hpp>

using namespace gwc_abst;

int main(int argc, const char* argv[])
{
    Render::init();
    WndMgr::init();

    WindowId window = WndMgr::alloc(800, 600, true);

    WndMgr::open();

    if (!WndMgr::isInitialized())
    {
        Render::shutdown();
        WndMgr::shutdown();

        return 1;
    }

    bool loop = true;

    while (WndMgr::isOpen() && loop)
    {
        gKeys modifiers = gKeys::None;
        gKeys key = gKeys::None;

        bool keyDown = WndMgr::consumeKeyDown(modifiers, key);

        if (keyDown)
        {
            if (key == gKeys::Escape)
            {
                loop = false;

                continue;
            }
        }

        WndMgr::wait(16);
    }

    if (WndMgr::isOpen())
    {
        WndMgr::close();
    }

    Render::shutdown();
    WndMgr::shutdown();

    return 0;
}

Utilizzo

Windows

Requisiti

  • .NET
    • .NET 10 Desktop Runtime
    • .NET Framework 4.8.1 Runtime
    • .NET Framework 4.7.2 Runtime
  • Microsoft Visual C++
    • Microsoft Visual C++ v14 Redistributable

Linux/macOS

Note

Possibile != Bello

Requisiti

Warning

GWC è supportata su Linux/macOS tramite Mono.
GWC.Mono è supportata su Linux/macOS tramite Mono.

  • Mono Runtime 6.12.0

Warning

GWC.Native è supportata su Linux/macOS tramite Wine.
GWC.Native.Abst è supportata su Linux/macOS tramite Wine.

  • Wine 10

Download

Mirror Url
GitHub Download
Altervista (Rilascio) Download
Altervista (Snapshot) Download

Compilazione

Windows

1. Prerequisiti

In Visual Studio Installer:

  • Sviluppo per Desktop .NET
    • .NET 10 SDK
    • .NET Framework 4.8.1 Targeting Pack
    • .NET Framework 4.8.1 SDK
    • .NET Framework 4.7.2 Targeting Pack
    • .NET Framework 4.7.2 SDK
  • Sviluppo di Applicazioni Desktop con C++
    • Supporto a C++/CLI (Ultima Versione)
    • Strumenti di Compilazione MSVC per x64/x86 (Ultima Versione)
    • Strumenti di Compilazione MSVC per ARM64/ARM64EC (Ultima Versione)

2. Sorgente

git clone https://github.com/reallukee/gwc.git

3. Configurazione

CD gwc

CD scripts

4. Compilazione

.\build_all.cmd

5. Pulizia (Opzionale)

.\clear_all.cmd

Linux/macOS

Note

Possibile != Bello

1. Prerequisiti

  • git
  • mono

2. Sorgente

git clone https://github.com/reallukee/gwc.git

3. Configurazione

cd gwc

cd scripts

4. Compilazione

chmod +x build_all.sh

./build_all.sh

5. Pulizia (Opzionale)

chmod +x clear_all.sh

./clear_all.sh

Autore

Licenza

Licenza MIT

About

🖼️ A C#, C++ and C graphics library written in C#, C++ and C

Topics

Resources

License

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Contributors