Giter Site home page Giter Site logo

koko's People

Contributors

drbawb avatar llogiq avatar

Watchers

 avatar

Forkers

llogiq

koko's Issues

hah. opengl support is borked.

Now that I'm back on my Mac for a minute I found an entertaining bug... as I understand it:

  • DirectX, like SDL, has the notion that the y-coordinate grows downwards in memory.
  • Whereas OpenGL (as SDL uses it) has the y-coordinate growing upward in memory.

When swapping cold regions out I rip the texture out of VRAM and RLE it for space savings
by setting the render target to the texture and calling Renderer#read_pixel_data().

Then when that gets swapped back in I just call Texture#update().

Apparently #update() handles the flipping, but #read_pixel_data() doesn't. (... or possibly vice versa.) So when I swap the region back in on a system using OpenGL: that region is upside down.


Not really sure how to fix this apart from:

  1. Don't rely on serializing the draw state to/from VRAM. (e.g: my initial "shadow draw" idea)
  2. Detect what platform koko is running on and swap in an RLE impl that reverses the row-order. (This does work, but it seems exceptionally hacky to me. Why use SDL2 exactly if I have to start writing platform specific code anyways? ๐Ÿ˜ž )

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.