First pass (untested) at RenderWritePixels()
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404187
This commit is contained in:
parent
7f4f3792ce
commit
2d9880b962
2 changed files with 6 additions and 6 deletions
|
@ -291,7 +291,7 @@ SDL_PROC_UNUSED(void, glRasterPos2d, (GLdouble x, GLdouble y))
|
||||||
SDL_PROC_UNUSED(void, glRasterPos2dv, (const GLdouble * v))
|
SDL_PROC_UNUSED(void, glRasterPos2dv, (const GLdouble * v))
|
||||||
SDL_PROC_UNUSED(void, glRasterPos2f, (GLfloat x, GLfloat y))
|
SDL_PROC_UNUSED(void, glRasterPos2f, (GLfloat x, GLfloat y))
|
||||||
SDL_PROC_UNUSED(void, glRasterPos2fv, (const GLfloat * v))
|
SDL_PROC_UNUSED(void, glRasterPos2fv, (const GLfloat * v))
|
||||||
SDL_PROC_UNUSED(void, glRasterPos2i, (GLint x, GLint y))
|
SDL_PROC(void, glRasterPos2i, (GLint x, GLint y))
|
||||||
SDL_PROC_UNUSED(void, glRasterPos2iv, (const GLint * v))
|
SDL_PROC_UNUSED(void, glRasterPos2iv, (const GLint * v))
|
||||||
SDL_PROC_UNUSED(void, glRasterPos2s, (GLshort x, GLshort y))
|
SDL_PROC_UNUSED(void, glRasterPos2s, (GLshort x, GLshort y))
|
||||||
SDL_PROC_UNUSED(void, glRasterPos2sv, (const GLshort * v))
|
SDL_PROC_UNUSED(void, glRasterPos2sv, (const GLshort * v))
|
||||||
|
|
|
@ -1273,9 +1273,9 @@ GL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
||||||
} else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) {
|
} else if (pixel_format == SDL_PIXELFORMAT_INDEX1MSB) {
|
||||||
data->glPixelStorei(GL_PACK_LSB_FIRST, 0);
|
data->glPixelStorei(GL_PACK_LSB_FIRST, 0);
|
||||||
}
|
}
|
||||||
//data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
data->glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||||
//data->glPixelStorei(GL_PACK_ROW_LENGTH,
|
data->glPixelStorei(GL_PACK_ROW_LENGTH,
|
||||||
// (pitch / bytes_per_pixel(pixel_format)));
|
(pitch / bytes_per_pixel(pixel_format)));
|
||||||
data->glReadBuffer(GL_FRONT);
|
data->glReadBuffer(GL_FRONT);
|
||||||
|
|
||||||
memset(pixels, 0xff, rect->h*pitch);
|
memset(pixels, 0xff, rect->h*pitch);
|
||||||
|
@ -1325,8 +1325,8 @@ GL_RenderWritePixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
||||||
data->glPixelStorei(GL_UNPACK_ROW_LENGTH,
|
data->glPixelStorei(GL_UNPACK_ROW_LENGTH,
|
||||||
(pitch / bytes_per_pixel(pixel_format)));
|
(pitch / bytes_per_pixel(pixel_format)));
|
||||||
|
|
||||||
data->glReadPixels(rect->x, rect->y+rect->h-1, rect->w, rect->h,
|
data->glRasterPos2i(rect->x, rect->y);
|
||||||
format, type, pixels);
|
data->glDrawPixels(rect->w, rect->h, format, type, pixels);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue