# SDL\_CreateCursor(): maximum cursor size

**URL:** <https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742>\
**Category:** SDL Development\
**Created:** [February 11, 2021, 10:01pm UTC](https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742 "2021-02-11T22:01:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ant\_222](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@Ant\_222](https://discourse.libsdl.org/u/Ant_222)\
**Post date:** [February 11, 2021, 10:01pm UTC](https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742/1 "2021-02-11T22:01:17Z")

</div>

Hello, all

Does SDL provide any kind of error-handling for its facili-  
ties SDL\_CreateCursor() and SDL\_SetCursor() for the imple-  
mentation of custom cursors? I am trying to implement a  
cross-platform function that shall generate a cursor bitmap  
of a size suitable to for the current display dimensions and  
DPI, in order that it shall not look too large or too small.

Unfortunately, my test program simply crashes if I try to  
install a cursor larger than a certain OS-specific limit.  
For example, my development machine with Windows XP supports  
cursors up to 32x32 pixels, but no larger – a fact I found  
out by direct experiment – tyring various sizes and seeing  
whether they caused a crash.

Is there a more elegant dynamic way of determining the maxi-  
mum cursor size, for I would rather not hard-code it into my  
algorithm for each OS?

---

<div class="post-metadata">

**Author:** ![Ant\_222](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@Ant\_222](https://discourse.libsdl.org/u/Ant_222)\
**Post date:** [February 11, 2021, 10:15pm UTC](https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742/2 "2021-02-11T22:15:42Z")

</div>

Although Discourse is advertised as a mailing-list manage-  
ment system, it is certainly is not equal to the task: I see  
that is has distorted my message by collapsing consequtive  
spaces used for justification and replaced ASCII dashes con-  
sisting of a pair of ASCII “minus” characters by single mi-  
nuses. Futhermore, it has excised my signature and committed  
the gross offence of displaying my e-mail in a proportional  
font, whereas hard-wrapped pre-formatted text must always be  
displayed in a monospace font. If my original post looks  
awful, it not my fault.

---

<div class="post-metadata">

**Author:** ![rtrussell](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/rtrussell/32/4768_2.png) [@rtrussell](https://discourse.libsdl.org/u/rtrussell)\
**Post date:** [February 11, 2021, 11:23pm UTC](https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742/3 "2021-02-11T23:23:40Z")

</div>

> [@Ant\_222](#):
>
> If my original post looks awful, it not my fault.

It looks fine to me on the [web page](https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742/2). The pair of ASCII ‘minus’ characters has been replaced by a single M-dash (–) which is precisely in line with your typographical intent, I would guess. There is some guidance on post formatting [here](https://meta.discourse.org/t/post-format-reference-documentation/19197).

---

<div class="post-metadata">

**Author:** ![Ant\_222](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/ba8739/32.png) [@Ant\_222](https://discourse.libsdl.org/u/Ant_222)\
**Post date:** [February 12, 2021, 11:44am UTC](https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742/4 "2021-02-12T11:44:33Z")

</div>

rtrussell to Anton Shepelev:

```
> > If my original post looks awful, it not my fault.
>
> It looks fine to me on the web page
> https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742/2).
> The pair of ASCII 'minus' characters has been replaced by
> a single M-dash (--) which is precisely in line with your
> typographical intent, I would guess.

But I wrote a 7-bit-clean ASCII message and did not give
permission to the mailing list to modify it. Here is what it
should look like:

   https://freeshell.de/~antonius/img_host/sdl_cursor_q.png

> There is some guidance on post formatting here:
> https://meta.discourse.org/t/post-format-reference-documentation/19197

I see it supports Markdown, BBCode, and HTML -- all new
stuff that did not exist when e-mail was invented, and no
decent mailing list may be expected -- let alone re-
quired -- to support these markup languages. e-mail is a
plain-text medium. Displaying e-mail messages in a propor-
tional font makes no sense because line length is measured
in characters, so one needs a character-cell device or medi-
um where all characters take the same rectangular area.

What is worse, e-mail notifications that I receive by way of
mailing-list mode are multi-part messages with a plain-text
and HTML parts. Only the plain-text part is correct. But I
trow I had better stop ranting about Discourse in an SDL
group. I wish you had not migrated your mailing lists to
Discourse, though!

I have formatted this e-mail as a Markdown code block, using
a four-space indent, but I fear that Disourse will fail to
recognise is it from e-mail, expecting me to do it via the
web interface...
```

---

<div class="post-metadata">

**Author:** ![Mason\_Wheeler](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/b9bd4f/32.png) [@Mason\_Wheeler](https://discourse.libsdl.org/u/Mason_Wheeler)\
**Post date:** [February 23, 2021, 11:00pm UTC](https://discourse.libsdl.org/t/sdl-createcursor-maximum-cursor-size/28742/5 "2021-02-23T23:00:33Z")

</div>

Yes, Discourse is awful, and it’s “maintained” by people who are actively hostile to bug reports and requests and suggestions on how to improve it. I warned the SDL team that this was the case when they were considering “upgrading” to Discourse, but they went with it anyway.
