Open
Description
I want to disable the mouse cursor, but i'm using WSL to develop my program.
Here is an example, we can see the cursor even though I disabled the cursor:
When I compile under Windows (VC++), the mouse is indeed hidden:
Example source code to replicate this issue:
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <iostream>
int main(int argc, char* argv[]) {
SDL_Window* window = nullptr;
SDL_Renderer* renderer = nullptr;
// Initialize SDL
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
std::cerr << "SDL_Init Error: " << SDL_GetError() << std::endl;
return 1;
}
// Create window
window = SDL_CreateWindow("Test Program", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, 0);
// Create renderer
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
// Disable cursor
SDL_ShowCursor(SDL_DISABLE);
bool running = true;
while (running) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
running = false;
}
}
SDL_RenderClear(renderer);
// do nothing
SDL_RenderPresent(renderer);
}
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
Compile it under unix: g++ main.cpp -lSDL2main -lSDL2
Run: ./a.out
Why I want to disable the cursor? because I want to render different cursor (some games use different cursors).
Here we can see VSCode using WSL as remote:
SDL2 Version on WSL:
2.0.20
SDL2 Version on Windows (VC++):
2.30.3
Metadata
Metadata
Assignees
Labels
No labels