(a) Discuss the concept of colour keying and how it works with SDL graphics surfaces. (1) Describe briefly colour keying
Posted: Sat Nov 27, 2021 2:35 pm
statement SDL_SetColorKey( loadedSurface, SDL_TRUE, SDL_MapRGB( loadedSurface->format, 0, 0xFF, OxFF)); The SDL_SetColorkey () function has three arguments. State the data type and the use of each argument. (9 marks)
(6) Appraise the use of SDL program for graphical application Figure 461) shows a sprite sheet containing a filled circle. Figure Q4(b)) Listing 0466)1) shows the SDL statements that are responsible for extracting the four quadrants of the circle. gSpriteclips[0].y = 0; gSpriteclips[@].h = 50; gSpriteclips[1].y = @; gSpriteclips[1].h = 50; // Set top left sprite gSpriteclips[@].x = 0; Espriteclips[@].w = 50; // Set top right sprite gSpriteclips[1].x = 50; gSpriteclips[1].w = 50; // Set bottom left sprite gSpriteclips[2].x = 0; eSpriteclips[2].w = 50; // Set bottom right sprite Spriteclips[3].x = 50; gSpriteclips(3).W = 50; gSpriteclips[2].y = 50; gSpriteclips[2].h = 50; gSpriteclips [3].y = 50; gSpriteclips[3].h = 50; Listing Q4(b)(i)
Listing 0466)(1) shows the SDL statements that are responsible for producing the output as shown in Figure 046) (11). for (int i = 0; i < 4; i++) { gSpriteSheetTexture.renderſi * 120, e, &gspriteclips[@]); [0 gSpriteSheetTexture.renderſi * 120 + 60, e, &gSpriteclips[1]); + , ]) gSpriteSheetTexture.renderſi * 120, 60, &gSpriteclips[2]); gSpriteSheetTexture.render(i + 120 + 60, 60, 8gspriteclips[3]); } Listing 04b) (ii) SOL Tutorial Figure Q4(b)(ii)
Write three additional for loops containing SDL statements that will produce the output as shown in Figure 046b)(111). SOLT NL LA KI Figure (4(b)(iii) (15 marks)
(a) Discuss the concept of colour keying and how it works with SDL graphics surfaces. (1) Describe briefly colour keying and explain its purpose. (6 marks) (11) Consider the (6) Appraise the use of SDL program for graphical application Figure 461) shows a sprite sheet containing a filled circle. Figure Q4(b)) Listing 0466)1) shows the SDL statements that are responsible for extracting the four quadrants of the circle. gSpriteclips[0].y = 0; gSpriteclips[@].h = 50; gSpriteclips[1].y = @; gSpriteclips[1].h = 50; // Set top left sprite gSpriteclips[@].x = 0; Espriteclips[@].w = 50; // Set top right sprite gSpriteclips[1].x = 50; gSpriteclips[1].w = 50; // Set bottom left sprite gSpriteclips[2].x = 0; eSpriteclips[2].w = 50; // Set bottom right sprite Spriteclips[3].x = 50; gSpriteclips(3).W = 50; gSpriteclips[2].y = 50; gSpriteclips[2].h = 50; gSpriteclips [3].y = 50; gSpriteclips[3].h = 50; Listing Q4(b)(i)
Listing 0466)(1) shows the SDL statements that are responsible for producing the output as shown in Figure 046) (11). for (int i = 0; i < 4; i++) { gSpriteSheetTexture.renderſi * 120, e, &gspriteclips[@]); [0 gSpriteSheetTexture.renderſi * 120 + 60, e, &gSpriteclips[1]); + , ]) gSpriteSheetTexture.renderſi * 120, 60, &gSpriteclips[2]); gSpriteSheetTexture.render(i + 120 + 60, 60, 8gspriteclips[3]); } Listing 04b) (ii) SOL Tutorial Figure Q4(b)(ii)
Write three additional for loops containing SDL statements that will produce the output as shown in Figure 046b)(111). SOLT NL LA KI Figure (4(b)(iii) (15 marks)