|
@@ -174,7 +174,7 @@ Window la_CreateWindowX11(int x, int y, int w, int h, char *title, int SyncToVBl
|
|
|
XSetNormalHints(MAIN.dpy, win, &my_hints);
|
|
|
}
|
|
|
|
|
|
- int attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 6, 0};
|
|
|
+ int attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, MAIN.GLMajor, GLX_CONTEXT_MINOR_VERSION_ARB, MAIN.GLMinor, 0};
|
|
|
if (((*r_glc) = glXCreateContextAttribsF(MAIN.dpy, MAIN.BestFBC, MAIN.glc, GL_TRUE, attribs)) == NULL){
|
|
|
printf("\n\tcannot create gl context\n\n"); exit(0);
|
|
|
}
|
|
@@ -387,7 +387,8 @@ void laSetFontFolderPath(char* absolute){
|
|
|
strcpy(MAIN.SysFontDir,absolute); int len=strlen(MAIN.SysFontDir);
|
|
|
if(MAIN.SysFontDir[len-1]!='/'){ MAIN.SysFontDir[len]='/'; MAIN.SysFontDir[len+1]=0; }
|
|
|
}
|
|
|
-int laGetReady(){
|
|
|
+
|
|
|
+int laGetReadyWith(int GLMajor, int GLMinor, int BufferSamples){
|
|
|
Window root, win;
|
|
|
GLint att[] = {GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None};
|
|
|
XSetWindowAttributes swa={0};
|
|
@@ -410,22 +411,23 @@ int laGetReady(){
|
|
|
|
|
|
la_ScanWacomDevices(MAIN.dpy,XIAllDevices);
|
|
|
|
|
|
- static int visual_attribs[] =
|
|
|
- {
|
|
|
- GLX_X_RENDERABLE , True,
|
|
|
- GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
|
|
|
- GLX_RENDER_TYPE , GLX_RGBA_BIT,
|
|
|
- GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
|
|
|
- GLX_RED_SIZE , 8,
|
|
|
- GLX_GREEN_SIZE , 8,
|
|
|
- GLX_BLUE_SIZE , 8,
|
|
|
- GLX_ALPHA_SIZE , 8,
|
|
|
- GLX_DEPTH_SIZE , 24,
|
|
|
- //GLX_STENCIL_SIZE , 8,
|
|
|
- GLX_DOUBLEBUFFER , True,
|
|
|
- GLX_SAMPLE_BUFFERS , 1,
|
|
|
- GLX_SAMPLES , 4,
|
|
|
- None
|
|
|
+ MAIN.GLMajor=GLMajor; MAIN.GLMinor=GLMinor; MAIN.BufferSamples=BufferSamples;
|
|
|
+
|
|
|
+ int visual_attribs[] = {
|
|
|
+ GLX_X_RENDERABLE , True,
|
|
|
+ GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
|
|
|
+ GLX_RENDER_TYPE , GLX_RGBA_BIT,
|
|
|
+ GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
|
|
|
+ GLX_RED_SIZE , 8,
|
|
|
+ GLX_GREEN_SIZE , 8,
|
|
|
+ GLX_BLUE_SIZE , 8,
|
|
|
+ GLX_ALPHA_SIZE , 8,
|
|
|
+ GLX_DEPTH_SIZE , 24,
|
|
|
+ //GLX_STENCIL_SIZE , 8,
|
|
|
+ GLX_DOUBLEBUFFER , True,
|
|
|
+ GLX_SAMPLE_BUFFERS , MAIN.BufferSamples?1:0,
|
|
|
+ GLX_SAMPLES , MAIN.BufferSamples?MAIN.BufferSamples:0,
|
|
|
+ None
|
|
|
};
|
|
|
|
|
|
int fbcount = -1;
|
|
@@ -454,7 +456,7 @@ int laGetReady(){
|
|
|
root = DefaultRootWindow(MAIN.dpy);
|
|
|
win = XCreateWindow(MAIN.dpy, root, 0, 0, 100, 100, 0, MAIN.xvi->depth, InputOutput, MAIN.xvi->visual, CWColormap | CWEventMask, &swa);
|
|
|
|
|
|
- int attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 6, 0};
|
|
|
+ int attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, MAIN.GLMajor, GLX_CONTEXT_MINOR_VERSION_ARB, MAIN.GLMinor, 0};
|
|
|
glXCreateContextAttribsF = (glXCreateContextAttribsARBProc) glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
|
|
|
if ((MAIN.glc = glXCreateContextAttribsF(MAIN.dpy, MAIN.BestFBC, NULL, GL_TRUE, attribs)) == NULL){
|
|
|
printf("\n\tcannot create gl context\n\n"); exit(0);
|
|
@@ -585,6 +587,11 @@ int laGetReady(){
|
|
|
|
|
|
logPrintNew("Initialization Completed\n");
|
|
|
MAIN.InitDone=1;
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+int laGetReady(){
|
|
|
+ return laGetReadyWith(3,3,0);
|
|
|
}
|
|
|
|
|
|
void laShutoff(int SavePrefereces){
|