An example illustrating buttons with SDL
TECHTRIKZ
technology, web, programming
Saturday, November 5, 2011
Saturday, October 1, 2011
Unable to share files and folders?????
If you are having problems with the functions of network related to sharing, this might help you.
If by any means the server service is disabled, you are going to be in a lot problem in sharing files using homegroup or even directly with LAN cable or addoc. Troubleshooting problems won't help you a bit. File and printer sharing can't be turned on. Share with options on the explorer and folder properties vanishes. You'll be unable to leave homegroup or fix any problem with homegroup. What you are left out with is problems and problems with your network.
Server
Windows 7
Default Description
Supports file, print, and named-pipe sharing over the network for this computer. If this service is stopped, these functions will be unavailable. If this service is disabled, any services that explicitly depend on it will fail to start.
Additional Information
None at this time.
Default Startup Type
OS | SP0 |
---|---|
Windows 7 Starter | Automatic (Started) |
Windows 7 Home Basic | Automatic (Started) |
Windows 7 Home Premium | Automatic (Started) |
Windows 7 Professional | Automatic (Started) |
Windows 7 Ultimate | Automatic (Started) |
Windows 7 Enterprise | Automatic (Started) |
Service Names
Service Name (registry): LanmanServer
Display Name: Server
Default Path and Command Line Options
C:\Windows\system32\svchost.exe -k netsvcs
Log On As
Account: Local System account
Dependencies
What service Server needs to function properly:
- Security Accounts Manager (S, HB, HP, P, U, E)
- Remote Procedure Call (RPC) (S, HB, HP, P, U, E)
- DCOM Server Process Launcher (S, HB, HP, P, U, E)
- RPC Endpoint Mapper (S, HB, HP, P, U, E)
- Remote Procedure Call (RPC) (S, HB, HP, P, U, E)
- Server SMB 1.xxx Driver (S, HB, HP, P, U, E)
- Server SMB 2.xxx Driver (S, HB, HP, P, U, E)
- srvnet (S, HB, HP, P, U, E)
- Server SMB 2.xxx Driver (S, HB, HP, P, U, E)
What other service require Server to function properly:
- Computer Browser (S, HB, HP, P, U, E)
- HomeGroup Listener (S, HB, HP, P, U, E)
If by any means the server service is disabled, you are going to be in a lot problem in sharing files using homegroup or even directly with LAN cable or addoc. Troubleshooting problems won't help you a bit. File and printer sharing can't be turned on. Share with options on the explorer and folder properties vanishes. You'll be unable to leave homegroup or fix any problem with homegroup. What you are left out with is problems and problems with your network.
Tuesday, July 26, 2011
Creating a button with SDL
Mouse Events
The mouse events—mouse motion and mouse button each have their own structures for dealing with the events.
Mouse Motion Events
A mouse motion event is stored in an SDL_MouseMotionEvent, which looks like this.
typedef struct{
Uint8 type;
Uint8 state;
Uint16 x, y;
Sint16 xrel, yrel;
} SDL_MouseMotionEvent;
As with all SDL event structures, the type member specifies what type of event has occurred. In the case of a mouse motion event, this constant will only ever be SDL_MOUSEMOTION.
The state member is a combination of bit flags that tells you which mouse buttons are currently pressed, if any. Table below shows these bit flags.
Monday, July 25, 2011
Working with text in SDL
Using SDL_ttf
Like SDL itself, SDL_ttf first needs to be initialized. The function for doing this is TTF_Init. Likewise, after the program ends, it needs to be uninitialized by calling TTF_Quit.
int TTF_Init(void);
void TTF_Quit(void);
TTF_Init will return 0 if all went well and -1 if an error occurred. TTF_Quit does not return any value.
Creation and Destruction
The creation and destruction functions deal with making and unmaking fonts. The structure that keeps font information is called TTF_Font.
TTF_Font * TTF_OpenFont(const char *file, int ptsize);
Like SDL itself, SDL_ttf first needs to be initialized. The function for doing this is TTF_Init. Likewise, after the program ends, it needs to be uninitialized by calling TTF_Quit.
int TTF_Init(void);
void TTF_Quit(void);
TTF_Init will return 0 if all went well and -1 if an error occurred. TTF_Quit does not return any value.
Creation and Destruction
The creation and destruction functions deal with making and unmaking fonts. The structure that keeps font information is called TTF_Font.
TTF_Font * TTF_OpenFont(const char *file, int ptsize);
Tuesday, July 12, 2011
SDL: Color Keys (Transparency)
A few times you’ll have portions of the image not to be visible when you blit. This is done by setting a transparent color key. You can select a single color that will be ignored when blitting.
To set a color key, use the SDL_SetColorKey function.
int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key);
This function returns an int. In typical SDL style, 0 means success and -1 means an error. The function has three parameters—a pointer to the surface for which you are setting the color key (surface), a set of
flags (flag), and a value to use as the transparent color (key). There are two different flags that you can use in the flag parameter. One is SDL_SRCCOLORKEY, and the other is SDL_RLEACCEL. The
To set a color key, use the SDL_SetColorKey function.
int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key);
This function returns an int. In typical SDL style, 0 means success and -1 means an error. The function has three parameters—a pointer to the surface for which you are setting the color key (surface), a set of
flags (flag), and a value to use as the transparent color (key). There are two different flags that you can use in the flag parameter. One is SDL_SRCCOLORKEY, and the other is SDL_RLEACCEL. The
Monday, July 11, 2011
Loading images other than bitmap on SDL
Though SDL natively supports only .bmp files, on using the SDL_image extension library, we are able to load BMP, PNM, XPM, LBM, PCX, GIF, JPEG, TGA and PNG files.
SDL_Surface * IMG_Load(const char *file);
This function takes a string that holds the name of a graphics file that you want to load. If successful, it will return a pointer to an SDL_Surface that contains that newly loaded image. If there is some sort of problem, the function will return NULL.
This function looks very much like SDL_LoadBMP. The only difference is that it can load images other than those with a .bmp extension.
SDL_Surface * IMG_Load(const char *file);
This function takes a string that holds the name of a graphics file that you want to load. If successful, it will return a pointer to an SDL_Surface that contains that newly loaded image. If there is some sort of problem, the function will return NULL.
This function looks very much like SDL_LoadBMP. The only difference is that it can load images other than those with a .bmp extension.
Sunday, July 10, 2011
Color fills in SDL
Color fills are typically only used to clear the screen or a large rectangular portion of the screen. They are still important, nonetheless. If you want to go deep, you can set individual pixels. If you can set a single pixel, you can do anything graphics-wise, such as drawing lines, circles, ellipses, polygons, and whatever else you can imagine. SDL has no functions for drawing these primitives, so if you want them you have to implement them yourself. The ability to retrieve the value of individual pixels goes hand-in-hand with setting them.
Subscribe to:
Posts (Atom)