mirror of
https://github.com/yawut/SDL.git
synced 2026-08-19 23:34:04 -05:00
big oops: missed a merge conflict on 2.0.9
This commit is contained in:
@@ -92,75 +92,6 @@ static int WIIU_CreateSDLWindow(_THIS, SDL_Window *window) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
static void render_scene(WIIU_WindowData *data) {
|
||||
WHBGfxClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
wiiuSetTextureShader();
|
||||
|
||||
GX2SetVertexUniformReg(wiiuTextureShader.vertexShader->uniformVars[0].offset, 4, (uint32_t *)u_viewSize);
|
||||
GX2SetVertexUniformReg(wiiuTextureShader.vertexShader->uniformVars[1].offset, 4, (uint32_t *)u_texSize);
|
||||
GX2SetPixelUniformReg(wiiuTextureShader.pixelShader->uniformVars[0].offset, 4, (uint32_t*)u_mod);
|
||||
GX2RSetAttributeBuffer(&position_buffer, 0, position_buffer.elemSize, 0);
|
||||
GX2RSetAttributeBuffer(&tex_coord_buffer, 1, tex_coord_buffer.elemSize, 0);
|
||||
|
||||
GX2SetPixelTexture(&data->texture, wiiuTextureShader.pixelShader->samplerVars[0].location);
|
||||
GX2SetPixelSampler(&sampler, wiiuTextureShader.pixelShader->samplerVars[0].location);
|
||||
|
||||
GX2DrawEx(GX2_PRIMITIVE_MODE_QUADS, 4, 0, 1);
|
||||
}
|
||||
|
||||
static int WIIU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
|
||||
{
|
||||
WIIU_WindowData *data = (WIIU_WindowData *) SDL_GetWindowData(window, WIIU_WINDOW_DATA);
|
||||
Uint32 flags = SDL_GetWindowFlags(window);
|
||||
float a_position[8];
|
||||
float* buffer;
|
||||
int x, y, w, h;
|
||||
|
||||
SDL_GetWindowPosition(window, &x, &y);
|
||||
SDL_GetWindowSize(window, &w, &h);
|
||||
a_position[0] = (float)x; a_position[1] = (float)y;
|
||||
a_position[2] = (float)(x + w); a_position[3] = (float)y;
|
||||
a_position[4] = (float)(x + w); a_position[5] = (float)(y + h);
|
||||
a_position[6] = (float)x; a_position[7] = (float)(y + h);
|
||||
|
||||
buffer = GX2RLockBufferEx(&position_buffer, 0);
|
||||
if (buffer) {
|
||||
memcpy(buffer, a_position, position_buffer.elemSize * position_buffer.elemCount);
|
||||
}
|
||||
GX2RUnlockBufferEx(&position_buffer, 0);
|
||||
|
||||
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_TEXTURE, data->texture.surface.image, data->texture.surface.imageSize);
|
||||
|
||||
WHBGfxBeginRender();
|
||||
|
||||
if (!(flags & SDL_WINDOW_WIIU_GAMEPAD_ONLY)) {
|
||||
WHBGfxBeginRenderTV();
|
||||
render_scene(data);
|
||||
WHBGfxFinishRenderTV();
|
||||
}
|
||||
|
||||
if (!(flags & SDL_WINDOW_WIIU_TV_ONLY)) {
|
||||
WHBGfxBeginRenderDRC();
|
||||
render_scene(data);
|
||||
WHBGfxFinishRenderDRC();
|
||||
}
|
||||
|
||||
WHBGfxFinishRender();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void WIIU_DestroyWindowFramebuffer(_THIS, SDL_Window *window)
|
||||
{
|
||||
WIIU_WindowData *data = (WIIU_WindowData*) SDL_GetWindowData(window, WIIU_WINDOW_DATA);
|
||||
SDL_FreeSurface(data->surface);
|
||||
MEMFreeToDefaultHeap(data->texture.surface.image);
|
||||
SDL_free(data);
|
||||
}
|
||||
|
||||
>>>>>>> video/wiiu: Add flags to only draw on TV or Gamepad (#1)
|
||||
static int WIIU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
|
||||
{
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user