Browse Source

Fixed warning running a command queue without any vertex operations

Sam Lantinga 2 years ago
parent
commit
f8b41919da
2 changed files with 2 additions and 1 deletions
  1. 1 0
      src/joystick/hidapi/SDL_hidapijoystick.c
  2. 1 1
      src/render/direct3d/SDL_render_d3d.c

+ 1 - 0
src/joystick/hidapi/SDL_hidapijoystick.c

@@ -808,6 +808,7 @@ static SDL_HIDAPI_Device *HIDAPI_AddDevice(const struct SDL_hid_device_info *inf
         return NULL;
     }
 
+#define DEBUG_HIDAPI
 #ifdef DEBUG_HIDAPI
     SDL_Log("Added HIDAPI device '%s' VID 0x%.4x, PID 0x%.4x, version %d, serial %s, interface %d, interface_class %d, interface_subclass %d, interface_protocol %d, usage page 0x%.4x, usage 0x%.4x, path = %s, driver = %s (%s)\n", device->name, device->vendor_id, device->product_id, device->version, device->serial ? device->serial : "NONE", device->interface_number, device->interface_class, device->interface_subclass, device->interface_protocol, device->usage_page, device->usage, device->path, device->driver ? device->driver->name : "NONE", device->driver && device->driver->enabled ? "ENABLED" : "DISABLED");
 #endif

+ 1 - 1
src/render/direct3d/SDL_render_d3d.c

@@ -1099,7 +1099,7 @@ static int D3D_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v
         return -1;
     }
 
-    if (vertices) {
+    if (vertsize > 0) {
         /* upload the new VBO data for this set of commands. */
         vbo = data->vertexBuffers[vboidx];
         if (data->vertexBufferSize[vboidx] < vertsize) {