comparison include/SDL_video.h @ 1727:90a3e0fccb88 SDL-1.3

Started on the OpenGL API revamp.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 07 Jul 2006 10:29:16 +0000
parents 98a3207ddde8
children 0ef52d56e8bb
comparison
equal deleted inserted replaced
1726:18223b2ec68c 1727:90a3e0fccb88
311 SDL_GL_ACCUM_BLUE_SIZE, 311 SDL_GL_ACCUM_BLUE_SIZE,
312 SDL_GL_ACCUM_ALPHA_SIZE, 312 SDL_GL_ACCUM_ALPHA_SIZE,
313 SDL_GL_STEREO, 313 SDL_GL_STEREO,
314 SDL_GL_MULTISAMPLEBUFFERS, 314 SDL_GL_MULTISAMPLEBUFFERS,
315 SDL_GL_MULTISAMPLESAMPLES, 315 SDL_GL_MULTISAMPLESAMPLES,
316 SDL_GL_ACCELERATED_VISUAL, 316 SDL_GL_ACCELERATED_VISUAL
317 SDL_GL_SWAP_CONTROL
318 } SDL_GLattr; 317 } SDL_GLattr;
319 318
320 319
321 /* Function prototypes */ 320 /* Function prototypes */
322 321
1375 1374
1376 /** 1375 /**
1377 * \fn int SDL_SoftStretch(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect) 1376 * \fn int SDL_SoftStretch(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect)
1378 * 1377 *
1379 * \brief Perform a fast, low quality, stretch blit between two surfaces of the same pixel format. 1378 * \brief Perform a fast, low quality, stretch blit between two surfaces of the same pixel format.
1379 *
1380 * \note This function uses a static buffer, and is not thread-safe. 1380 * \note This function uses a static buffer, and is not thread-safe.
1381 */ 1381 */
1382 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, 1382 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
1383 SDL_Rect * srcrect, 1383 SDL_Rect * srcrect,
1384 SDL_Surface * dst, 1384 SDL_Surface * dst,
1386 1386
1387 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1387 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1388 /* OpenGL support functions. */ 1388 /* OpenGL support functions. */
1389 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 1389 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1390 1390
1391 /* 1391 /**
1392 * Dynamically load an OpenGL library, or the default one if path is NULL 1392 * \fn int SDL_GL_LoadLibrary(const char *path)
1393 * 1393 *
1394 * If you do this, you need to retrieve all of the GL functions used in 1394 * \brief Dynamically load an OpenGL library.
1395 * your program from the dynamic library using SDL_GL_GetProcAddress(). 1395 *
1396 * \param path The platform dependent OpenGL library name, or NULL to open the default OpenGL library
1397 *
1398 * \return 0 on success, or -1 if the library couldn't be loaded
1399 *
1400 * \note If you do this, you need to retrieve all of the GL functions used in
1401 * your program from the dynamic library using SDL_GL_GetProcAddress().
1402 *
1403 * \sa SDL_GL_GetProcAddress()
1396 */ 1404 */
1397 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); 1405 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
1398 1406
1399 /* 1407 /**
1400 * Get the address of a GL function 1408 * \fn void *SDL_GL_GetProcAddress(const char *proc)
1409 *
1410 * \brief Get the address of an OpenGL function.
1401 */ 1411 */
1402 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); 1412 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
1403 1413
1404 /* 1414 /**
1405 * Set an attribute of the OpenGL subsystem before window creation. 1415 * \fn int SDL_GL_SetAttribute(SDL_GLattr attr, int value)
1416 *
1417 * \brief Set an OpenGL window attribute before window creation.
1406 */ 1418 */
1407 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); 1419 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
1408 1420
1409 /* 1421 /**
1410 * Get an attribute of the OpenGL subsystem from the windowing 1422 * \fn int SDL_GL_GetWindowAttribute(SDL_WindowID windowID, SDL_GLattr attr, int *value)
1411 * interface, such as glX. This is of course different from getting 1423 *
1412 * the values from SDL's internal OpenGL subsystem, which only 1424 * \brief Get the actual value for an OpenGL window attribute.
1413 * stores the values you request before initialization. 1425 */
1414 * 1426 extern DECLSPEC int SDLCALL SDL_GL_GetWindowAttribute(SDL_WindowID windowID,
1415 * Developers should track the values they pass into SDL_GL_SetAttribute 1427 SDL_GLattr attr,
1416 * themselves if they want to retrieve these values. 1428 int *value);
1417 */ 1429
1418 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); 1430 /**
1419 1431 * \fn SDL_GLContext SDL_GL_CreateContext(SDL_WindowID windowID)
1420 /* 1432 *
1433 * \brief Create an OpenGL context for use with an OpenGL window, and make it current.
1434 *
1435 * \sa SDL_GL_DeleteContext()
1436 */
1437 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID
1438 windowID);
1439
1440 /**
1441 * \fn int SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context)
1442 *
1443 * \brief Set up an OpenGL context for rendering into an OpenGL window.
1444 *
1445 * \note The context must have been created with a compatible window.
1446 */
1447 extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID,
1448 SDL_GLContext context);
1449
1450 /**
1451 * \fn int SDL_GL_SetSwapInterval(int interval)
1452 *
1453 * \brief Set the swap interval for the current OpenGL context.
1454 *
1455 * \sa SDL_GL_GetSwapInterval()
1456 */
1457 extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
1458
1459 /**
1460 * \fn int SDL_GL_GetSwapInterval(void)
1461 *
1462 * \brief Get the swap interval for the current OpenGL context.
1463 *
1464 * \sa SDL_GL_SetSwapInterval()
1465 */
1466 extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
1467
1468 /**
1469 * \fn void SDL_GL_SwapBuffers(void)
1470 *
1421 * Swap the OpenGL buffers, if double-buffering is supported. 1471 * Swap the OpenGL buffers, if double-buffering is supported.
1422 */ 1472 */
1423 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); 1473 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
1474
1475 /**
1476 * \fn void SDL_GL_DeleteContext(SDL_GLContext context)
1477 *
1478 * \brief Delete an OpenGL context.
1479 *
1480 * \sa SDL_GL_CreateContext()
1481 */
1482 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
1424 1483
1425 /* 1484 /*
1426 * Calculate the intersection of two rectangles 1485 * Calculate the intersection of two rectangles
1427 */ 1486 */
1428 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, 1487 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,