Code Monkey home page Code Monkey logo

p5_terminal_graphics's People

Contributors

clankill3r avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

p5_terminal_graphics's Issues

OpenGL error 1282 at top endDraw(): invalid operation

Right now the std_err.txt file always contains the following:

OpenGL error 1282 at top endDraw(): invalid operation
The pixels array is null.

To explain the issue, I first will explain how this library is done.

The P5_Terminal_Graphics extends the PGraphics3D (better known as P3D).
After a frame is done we draw the result on a smaller image:

resized_g.beginDraw();
resized_g.image(parent.g, 0, 0, resized_g.width, resized_g.height);
resized_g.endDraw();

And then we get the pixels of the smaller image:

resized_g.loadPixels();

This avoid loadPixels on the main graphics, which can be really slow depending on the size.
However, it really screws up the renderer which makes it freeze the normal processing window.
The reason for this is that we do it in the post method, which is not safe to draw in.
But it's the only way to get it working, or to get it working without loosing a lot of speed (I can't remember).

update processings PDE console

It would be great if this could work inside the PDE as well. For this processing console would need:

  • input support
  • ansii support
  • stty commands support (to get the size of the console window for example)

And possibly more, but I think processing users would look forward for a beter console in general.

support for more keys

At the time of writing this is the code that deals with the keyTyped support:

terminal_read_input_vk_keys((vk_key)-> {

            // in the processing source this is event.getModifiersEx();
            // Not sure if 0 is always fine in our case, but for now I don't need more.
            int modiefiers = 0; 
            char c_key = (char)vk_key;

            // This can probably done better, but the KeyEvent class
            // that oracle provides lacks some really usefull methods.
            // For example a static method to get the char of a VK_key...
            // https://stackoverflow.com/questions/62967633/get-char-of-vk-key
            switch (vk_key) {
                case VK_UP: 
                case VK_LEFT:
                case VK_RIGHT:
                case VK_DOWN:
                c_key = CHAR_UNDEFINED;
                break;
            }

            parent.postEvent(new KeyEvent(null, parent.millis(), KeyEvent.TYPE, modiefiers, c_key, vk_key));

        });

There are so much more keys that could be supported, but at the moment I have more pressing things to do.
Also I'm on a laptop right now and I don't want to assume things work the first time...

Automaticly sort character set

As described in the readme it is possible to change the character set:

P5_Terminal_Graphics.sequence = " /\\X";

But the characters have to be arranged in order of brightness.
Having a lookup table like this:

int[] char_index_to_brightness = {...};

Could help with writing code that could sort a given character set so they user could provide the characters to be used in any order they wan't.

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.