aboutsummaryrefslogtreecommitdiffstats
path: root/distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2012-11-18 15:47:18 -0800
committerSteve Kondik <shade@chemlab.org>2012-11-18 15:47:18 -0800
commita546c7006355a7bd1df4267ee53d0bfa2c017c8c (patch)
tree01be0bf6c0d6968e1468ec9661fd52110f9b05a7 /distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3
parentbaf3d7830396202df5cc47bd7bcee109c319cdb3 (diff)
parent0f809250987b64f491bd3b4b73c0f0d33036a786 (diff)
downloadexternal_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.zip
external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.gz
external_qemu-a546c7006355a7bd1df4267ee53d0bfa2c017c8c.tar.bz2
Merge branch 'jb-mr1-release' of https://android.googlesource.com/platform/external/qemu into mr1-staging
Change-Id: I8a4a71ac65b08e6e17f26c942f67a15b85211115
Diffstat (limited to 'distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3')
-rw-r--r--distrib/sdl-1.2.15/docs/man3/SDL_SetColors.357
1 files changed, 57 insertions, 0 deletions
diff --git a/distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3 b/distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3
new file mode 100644
index 0000000..7137a6c
--- /dev/null
+++ b/distrib/sdl-1.2.15/docs/man3/SDL_SetColors.3
@@ -0,0 +1,57 @@
+.TH "SDL_SetColors" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
+.SH "NAME"
+SDL_SetColors \- Sets a portion of the colormap for the given 8-bit surface\&.
+.SH "SYNOPSIS"
+.PP
+\fB#include "SDL\&.h"
+.sp
+\fBint \fBSDL_SetColors\fP\fR(\fBSDL_Surface *surface, SDL_Color *colors, int firstcolor, int ncolors\fR);
+.SH "DESCRIPTION"
+.PP
+Sets a portion of the colormap for the given 8-bit surface\&.
+.PP
+When \fBsurface\fR is the surface associated with the current display, the display colormap will be updated with the requested colors\&. If \fBSDL_HWPALETTE\fP was set in \fISDL_SetVideoMode\fR flags, \fBSDL_SetColors\fP will always return \fB1\fR, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation\&.
+.PP
+The color components of a \fI\fBSDL_Color\fR\fR structure are 8-bits in size, giving you a total of 256^3 =16777216 colors\&.
+.PP
+Palettized (8-bit) screen surfaces with the \fBSDL_HWPALETTE\fP flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display)\&. \fBSDL_SetColors\fP modifies both palettes (if present), and is equivalent to calling \fISDL_SetPalette\fR with the \fBflags\fR set to \fB(SDL_LOGPAL | SDL_PHYSPAL)\fP\&.
+.SH "RETURN VALUE"
+.PP
+If \fBsurface\fR is not a palettized surface, this function does nothing, returning \fB0\fR\&. If all of the colors were set as passed to \fBSDL_SetColors\fP, it will return \fB1\fR\&. If not all the color entries were set exactly as given, it will return \fB0\fR, and you should look at the surface palette to determine the actual color palette\&.
+.SH "EXAMPLE"
+.PP
+.nf
+\f(CW/* Create a display surface with a grayscale palette */
+SDL_Surface *screen;
+SDL_Color colors[256];
+int i;
+\&.
+\&.
+\&.
+/* Fill colors with color information */
+for(i=0;i<256;i++){
+ colors[i]\&.r=i;
+ colors[i]\&.g=i;
+ colors[i]\&.b=i;
+}
+
+/* Create display */
+screen=SDL_SetVideoMode(640, 480, 8, SDL_HWPALETTE);
+if(!screen){
+ printf("Couldn\&'t set video mode: %s
+", SDL_GetError());
+ exit(-1);
+}
+
+/* Set palette */
+SDL_SetColors(screen, colors, 0, 256);
+\&.
+\&.
+\&.
+\&.\fR
+.fi
+.PP
+.SH "SEE ALSO"
+.PP
+\fI\fBSDL_Color\fR\fR \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_SetPalette\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR
+.\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01