| Summary: | Initial value of GL_UNPACK_ROW_LENGTH is set to window width | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Patric Ljung <patric.ljung> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72 |
| Version: | 2.0.5 | ||
| Hardware: | x86_64 | ||
| OS: | macOS 10.12 | ||
| Attachments: | test program | ||
|
Description
Patric Ljung
2017-03-12 22:08:16 UTC
SDL_Render's internal code sets the value of GL_UNPACK_ROW_LENGTH to the number of pixels in a SDL texture when you create or modify one. SDL makes no guarantees about the OpenGL state for the context it uses for SDL_Render operations outside of internal SDL_Render API calls – using raw OpenGL with SDL_Render is effectively not supported. I am not using SDL_Render in my code at all. This is the code setting up SDL.
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fprintf(stderr, "Failed to initialize SDL: Error = %s\n", SDL_GetError());
return -1;
}
app.window = SDL_CreateWindow("SDL GL Test",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
SCREEN_WIDTH, SCREEN_HEIGHT,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN);
if (!app.window) {
fprintf(stderr, "Failed to create window, error = %s\n", SDL_GetError());
return -1;
}
// Create context
// Use OpenGL 3.1 core
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 4);
app.glcontext = SDL_GL_CreateContext(app.window);
if (app.glcontext == NULL)
{
fprintf(stderr, "OpenGL context could not be created! SDL Error: %s\n", SDL_GetError());
}
Followed by setting up glew
// Initialize GLEW
glewExperimental = GL_TRUE;
GLenum glewError = glewInit();
if (glewError != GLEW_OK) {
fprintf(stderr, "Error initializing GLEW! %s\n", glewGetErrorString(glewError));
}
This does not reproduce here with SDL 2.0.5 or the latest in revision control, on macOS 10.12.4. Is it possible GLEW, or something else, changed it? (we _will_ change it with the Render API, but this attached program does not.) --ryan. Created attachment 2743 [details]
test program
Closing this bug, but please reopen it if we can find a way to reproduce it! Thanks, --ryan. |