X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=SDL_CreateCursor.html;h=ed51ba84d4e03dd89b53a312b3bb5c440ae4dfe0;hb=54000f992df4436604a873a720934c135f292dc1;hp=e857fbc12201ba936d6b3118b323b1d9a374caf6;hpb=c096f5655e021c343b220814c0169acaaf8cd1b2;p=sdl2referencejp%2Fsdl2referencejp.git diff --git a/SDL_CreateCursor.html b/SDL_CreateCursor.html index e857fbc..ed51ba8 100644 --- a/SDL_CreateCursor.html +++ b/SDL_CreateCursor.html @@ -13,7 +13,6 @@
SDL_Cursor* SDL_CreateCursor(const Uint8* data, const Uint8* mask, int w, int h, int hot_x, int hot_y)
+
+
+
+/* [OXg©çqØ */
+/* XPM©çVµ¢}EXJ[\𶬷é */
+
+
+/* XPM */
+static const char *arrow[] = {
+ /* width height num_colors chars_per_pixel */
+ " 32 32 3 1",
+ /* colors */
+ "X c #000000",
+ ". c #ffffff",
+ " c None",
+ /* pixels */
+ "X ",
+ "XX ",
+ "X.X ",
+ "X..X ",
+ "X...X ",
+ "X....X ",
+ "X.....X ",
+ "X......X ",
+ "X.......X ",
+ "X........X ",
+ "X.....XXXXX ",
+ "X..X..X ",
+ "X.X X..X ",
+ "XX X..X ",
+ "X X..X ",
+ " X..X ",
+ " X..X ",
+ " X..X ",
+ " XX ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "0,0"
+};
+
+static SDL_Cursor *init_system_cursor(const char *image[])
+{
+ int i, row, col;
+ Uint8 data[4*32];
+ Uint8 mask[4*32];
+ int hot_x, hot_y;
+
+ i = -1;
+ for (row=0; row<32; ++row) {
+ for (col=0; col<32; ++col) {
+ if (col % 8) {
+ data[i] <<= 1;
+ mask[i] <<= 1;
+ } else {
+ ++i;
+ data[i] = mask[i] = 0;
+ }
+ switch (image[4+row][col]) {
+ case 'X':
+ data[i] |= 0x01;
+ mask[i] |= 0x01;
+ break;
+ case '.':
+ mask[i] |= 0x01;
+ break;
+ case ' ':
+ break;
+ }
+ }
+ }
+ sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
+ return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
+}
+
+
+maskÍMSB`®Å é. +
+J[\Ì(w)Í8Ì{ÌKvª é.
@@ -48,7 +138,12 @@
FÌ¢½J[\ªKvÈçÎ, ±ÌÖÍü¢Ä¢È¢. ãíèÉ, ÊíÌJ[\ðSDL_ShowCursor()ÅBµ, C[vÅSDL_Surface()ðJ[\ÌÊuÉ`Kvª é. -(óÒ: ±êÍâà¾Å, SDL_CreateColorCursor()ðg¦ÎÂ\È͸.) +
++ܽÍ, SDL_CreateColorCursor()ðgÁÄàæ¢. +
++SDL 2.0.0È~ÅÍSDL_CreateSystemCursor()ÅùÉ é11ÌVXeJ[\ªg¦é.