3 ms·
Would you mind sharing the scaling/filtering code you spoke of?
by likeclockwork 12y ago
Would you mind sharing the scaling/filtering code you spoke of?
- byuu 12y agoSure. Here is the main index: https://gitorious.org/bsnes/bsnes/source/1a7bc6bb8767d6464e3ed7f1887398bfbd62dc3c:ruby/video https://gitorious.org/bsnes/bsnes/source/1a7bc6bb8767d6464e3... The platform abstraction layers are wgl.cpp, cgl.cpp and glx.cpp Go inside the opengl/ subfolder to find all the platform-agnostic OpenGL code. opengl/surface.hpp gets particularly fun using matrix multiplication to compute model view / projection / texture coordinates by hand (which you need to do for the new GL3 / no-fixed-function-pipeline stuff.) Also has lots of required internal allocations. In my own case, I allow user-defined additional shader passes, and that adds to the code a bit. But note that another thing about GL3 is that you do actually have to create and execute at least one vertex + one fragment shader. GL2's FFP, while still difficult, was a whole lot easier. The driver did a lot of the work you have to do manually if you want to follow GL3.2-core/GL ES/etc.