mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-30 23:29:08 +00:00
Reverted deliberately broken segments to produce something mergeable.
This commit is contained in:
parent
a74f081aa9
commit
c73751b15a
@ -43,14 +43,8 @@
|
|||||||
|
|
||||||
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext)
|
static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext)
|
||||||
{
|
{
|
||||||
static int d = 0;
|
|
||||||
d++;
|
|
||||||
if(d == 10)
|
|
||||||
{
|
|
||||||
d = 0;
|
|
||||||
CSOpenGLView *const view = (__bridge CSOpenGLView *)displayLinkContext;
|
CSOpenGLView *const view = (__bridge CSOpenGLView *)displayLinkContext;
|
||||||
[view drawAtTime:now frequency:CVDisplayLinkGetActualOutputVideoRefreshPeriod(displayLink)];
|
[view drawAtTime:now frequency:CVDisplayLinkGetActualOutputVideoRefreshPeriod(displayLink)];
|
||||||
}
|
|
||||||
return kCVReturnSuccess;
|
return kCVReturnSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ OpenGLOutputBuilder::OpenGLOutputBuilder(unsigned int buffer_depth) :
|
|||||||
_buffer_builder = std::unique_ptr<CRTInputBufferBuilder>(new CRTInputBufferBuilder(buffer_depth));
|
_buffer_builder = std::unique_ptr<CRTInputBufferBuilder>(new CRTInputBufferBuilder(buffer_depth));
|
||||||
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_CONSTANT_COLOR);
|
glBlendFunc(GL_SRC_ALPHA, GL_CONSTANT_COLOR);
|
||||||
glBlendColor(0.0f, 0.0f, 0.0f, 1.0f);
|
glBlendColor(0.6f, 0.6f, 0.6f, 1.0f);
|
||||||
|
|
||||||
// Create intermediate textures and bind to slots 0, 1 and 2
|
// Create intermediate textures and bind to slots 0, 1 and 2
|
||||||
compositeTexture = std::unique_ptr<OpenGL::TextureTarget>(new OpenGL::TextureTarget(IntermediateBufferWidth, IntermediateBufferHeight, composite_texture_unit));
|
compositeTexture = std::unique_ptr<OpenGL::TextureTarget>(new OpenGL::TextureTarget(IntermediateBufferWidth, IntermediateBufferHeight, composite_texture_unit));
|
||||||
@ -196,35 +196,6 @@ void OpenGLOutputBuilder::draw_frame(unsigned int output_width, unsigned int out
|
|||||||
_drawn_source_buffer_data_pointer = _source_buffer_data_pointer;
|
_drawn_source_buffer_data_pointer = _source_buffer_data_pointer;
|
||||||
_drawn_output_buffer_data_pointer = _output_buffer_data_pointer;
|
_drawn_output_buffer_data_pointer = _output_buffer_data_pointer;
|
||||||
|
|
||||||
for(int c = 0; c < number_of_source_drawing_zones; c++)
|
|
||||||
{
|
|
||||||
printf("src: + %0.0f\n", (float)source_drawing_zones[c*2 + 1] / (2.0f * SourceVertexSize));
|
|
||||||
int offset = source_drawing_zones[c*2 + 0];
|
|
||||||
uint16_t *base = (uint16_t *)&_source_buffer_data[offset];
|
|
||||||
printf("(%d/%d) -> (%d/%d)\n", base[2], base[3], base[10], base[11]);
|
|
||||||
|
|
||||||
offset += source_drawing_zones[c*2 + 1] - 2*SourceVertexSize;
|
|
||||||
base = (uint16_t *)&_source_buffer_data[offset];
|
|
||||||
printf("(%d/%d) -> (%d/%d)\n", base[2], base[3], base[10], base[11]);
|
|
||||||
}
|
|
||||||
printf("tx: + %d\n", completed_texture_y);
|
|
||||||
for(int c = 0; c < number_of_clearing_zones; c++)
|
|
||||||
{
|
|
||||||
printf("cl: %d + %d\n", clearing_zones[c*2], clearing_zones[c*2 + 1]);
|
|
||||||
}
|
|
||||||
for(int c = 0; c < number_of_output_drawing_zones; c++)
|
|
||||||
{
|
|
||||||
printf("o: + %0.0f\n", (float)output_drawing_zones[c*2 + 1] / (6.0f * OutputVertexSize));
|
|
||||||
int offset = output_drawing_zones[c*2 + 0];
|
|
||||||
uint16_t *base = (uint16_t *)&_output_buffer_data[offset];
|
|
||||||
printf("(%d/%d) -> (%d/%d)\n", base[2], base[3], base[14], base[15]);
|
|
||||||
|
|
||||||
offset += output_drawing_zones[c*2 + 1] - 6*OutputVertexSize;
|
|
||||||
base = (uint16_t *)&_output_buffer_data[offset];
|
|
||||||
printf("(%d/%d) -> (%d/%d)\n", base[2], base[3], base[14], base[15]);
|
|
||||||
}
|
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
// release the mapping, giving up on trying to draw if data has been lost
|
// release the mapping, giving up on trying to draw if data has been lost
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, output_array_buffer);
|
glBindBuffer(GL_ARRAY_BUFFER, output_array_buffer);
|
||||||
for(int c = 0; c < number_of_output_drawing_zones; c++)
|
for(int c = 0; c < number_of_output_drawing_zones; c++)
|
||||||
|
@ -159,7 +159,7 @@ std::unique_ptr<IntermediateShader> IntermediateShader::make_rgb_source_shader(c
|
|||||||
|
|
||||||
"void main(void)"
|
"void main(void)"
|
||||||
"{"
|
"{"
|
||||||
"fragColour = vec3(0.2) + rgb_sample(texID, inputPositionsVarying[5], iInputPositionVarying);"
|
"fragColour = rgb_sample(texID, inputPositionsVarying[5], iInputPositionVarying);"
|
||||||
"}"
|
"}"
|
||||||
, rgb_shader);
|
, rgb_shader);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user