'\" t .\" Title: waffle_context .\" Author: Chad Versace .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 03/25/2021 .\" Manual: Waffle Manual .\" Source: waffle .\" Language: English .\" .TH "WAFFLE_CONTEXT" "3" "03/25/2021" "waffle" "Waffle Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" waffle_context, waffle_context_create, waffle_context_destroy, waffle_context_get_native \- class waffle_context .SH "SYNOPSIS" .sp .ft B .nf #include struct waffle_context; .fi .ft .HP \w'struct\ waffle_context*\ waffle_context_create('u .BI "struct waffle_context* waffle_context_create(struct\ waffle_config\ *" "config" ", struct\ waffle_context\ *" "shared_ctx" ");" .HP \w'bool\ waffle_context_destroy('u .BI "bool waffle_context_destroy(struct\ waffle_context\ *" "self" ");" .HP \w'union\ waffle_native_context*\ waffle_context_get_native('u .BI "union waffle_native_context* waffle_context_get_native(struct\ waffle_context\ *" "self" ");" .SH "DESCRIPTION" .PP \fBstruct waffle_context\fR .RS 4 An opaque type\&. .RE .PP \fBwaffle_context_create()\fR .RS 4 Create a context for OpenGL rendering with the properties specified by \fIconfig\fR\&. .sp The returned context\*(Aqs actual properties may differ from, but are guaranteed to be compatible with, the properties specified by \fIconfig\fR\&. See the section called \(lqVERSION PROMOTION\(rq below for details\&. .sp If \fIshare_ctx\fR is not null, then the newly created context is added to the share group of \fIshare_ctx\fR\&. Some data, such as display lists, are shared among all contexts that belong to the same share group\&. For details on what data is shared, see the specification for the relevant native platform: the \m[blue]\fBGLX 1\&.4 Specification\fR\m[]\&\s-2\u[1]\d\s+2, the \m[blue]\fBEGL 1\&.4 Specification\fR\m[]\&\s-2\u[2]\d\s+2, or the \m[blue]\fBCGL Reference\fR\m[]\&\s-2\u[3]\d\s+2\&. .RE .PP \fBwaffle_context_destroy()\fR .RS 4 Destroy the context and release its memory\&. .RE .PP \fBwaffle_context_get_native()\fR .RS 4 Get the context\*(Aqs underlying native objects\&. Use \fBfree\fR(3) to deallocate the returned pointer\&. See \fBwaffle_native\fR(3) for the definition of \fBunion waffle_native_context\fR\&. .RE .SH "VERSION PROMOTION" .PP The context\*(Aqs requested version and profile is given by the config attributes \fBWAFFLE_CONTEXT_MAJOR_VERSION\fR, \fBWAFFLE_CONTEXT_MINOR_VERSION\fR, \fBWAFFLE_CONTEXT_PROFILE\fR\&. The context returned by \fBwaffle_context_create\fR may implement any version and profile that is backwards compatible with that requested, as described below\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the chosen API is \fBWAFFLE_OPENGL_ES1\fR, \fBWAFFLE_OPENGL_ES2\fR, or \fBWAFFLE_OPENGL_ES3\fR, then the returned context may implement any of: .RS 4 * The requested version\&. .RE .RS 4 * Any later version, so long as no features have been from that later version\&. .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the chosen API is \fBWAFFLE_CONTEXT_OPENGL\fR and version 3\&.0 or less is requested, then the returned context may implement any of: .RS 4 * Any version no less than that requested and no greater than 3\&.0\&. .RE .RS 4 * Version 3\&.1, if the GL_ARB_compatibility extension is also implemented\&. .RE .RS 4 * The compatibility profile of version 3\&.2 or greater\&. .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the chosen API is \fBWAFFLE_CONTEXT_OPENGL\fR and version 3\&.1 is requested, then the returned context may implement any of: .RS 4 * Version 3\&.1, with or without the GL_ARB_compatibility extension\&. .RE .RS 4 * The core profile of version 3\&.2 or greater\&. .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the chosen API is \fBWAFFLE_CONTEXT_OPENGL\fR and version 3\&.2 or greater is requested, then the returned context may implement any of: .RS 4 * The requested profile and version\&. .RE .RS 4 * The requested profile of any later version, so long as no features have been from that later version and profile\&. .RE .RE .sp .SH "RETURN VALUE" .PP Functions whose return type is \fBbool\fR return true on success and false on failure\&. Functions whose return type is a pointer return \fBNULL\fR on failure\&. Use \fBwaffle_error_get_info\fR(3) to get information about any errors\&. .SH "ERRORS" .PP See \fBwaffle_error\fR(3) for the complete list of waffle\*(Aqs error codes\&. .PP No errors are specific to the \fBwaffle_context\fR functions\&. .SH "ISSUES" .PP Please report bugs or and feature requests to \m[blue]\fB\%https://gitlab.freedesktop.org/mesa/waffle/issues\fR\m[]\&. .SH "SEE ALSO" .PP \fBwaffle\fR(7) \fBwaffle_config_choose\fR(3) .SH "AUTHOR" .PP \fBChad Versace\fR <\&chad\&.versace@linux\&.intel\&.com\&> .RS 4 Maintainer .RE .SH "COPYRIGHT" .br Copyright \(co 2013 Intel .br .PP This manual page is licensed under the Creative Commons Attribution\-ShareAlike 3\&.0 United States License (CC BY\-SA 3\&.0)\&. To view a copy of this license, visit \m[blue]\fB\%http://creativecommons.org.license/by-sa/3.0/us\fR\m[]\&. .sp .SH "NOTES" .IP " 1." 4 GLX 1.4 Specification .RS 4 \%http://www.opengl.org/registry/doc/glx1.4.pdf .RE .IP " 2." 4 EGL 1.4 Specification .RS 4 \%http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf .RE .IP " 3." 4 CGL Reference .RS 4 \%https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGL_OpenGL/Reference/reference.html .RE