mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
Added correct include files to files,
No longer modify cmap if the device is truecolor (messes up dual monitors with vt switching)
This commit is contained in:
parent
0337e5635f
commit
0570fcfd93
10 changed files with 21 additions and 9 deletions
|
|
@ -24,6 +24,8 @@
|
||||||
* Written by Sean D'Epagnier (c) 2006
|
* Written by Sean D'Epagnier (c) 2006
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
* Written by Sean D'Epagnier (c) 2006
|
* Written by Sean D'Epagnier (c) 2006
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
|
|
@ -37,7 +38,7 @@
|
||||||
#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1))
|
#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1))
|
||||||
#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1)
|
#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1)
|
||||||
|
|
||||||
static struct fb_cmap ColorMap;
|
static struct fb_cmap ColorMap, OriginalColorMap;
|
||||||
|
|
||||||
unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256];
|
unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,10 @@
|
||||||
to render the cursor, this is faster, it would be good to use a hardware
|
to render the cursor, this is faster, it would be good to use a hardware
|
||||||
cursor if it exists instead */
|
cursor if it exists instead */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@
|
||||||
* Written by Sean D'Epagnier (c) 2006
|
* Written by Sean D'Epagnier (c) 2006
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glut.h>
|
#include <GL/glut.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -571,7 +571,8 @@ void SetVideoMode(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize colormap */
|
/* initialize colormap */
|
||||||
LoadColorMap();
|
if(FixedInfo.visual != FB_VISUAL_TRUECOLOR)
|
||||||
|
LoadColorMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateBuffer()
|
void CreateBuffer()
|
||||||
|
|
@ -786,6 +787,7 @@ void glutDestroyWindow(int win)
|
||||||
glFBDevDestroyContext(Context);
|
glFBDevDestroyContext(Context);
|
||||||
glFBDevDestroyBuffer(Buffer);
|
glFBDevDestroyBuffer(Buffer);
|
||||||
glFBDevDestroyVisual(Visual);
|
glFBDevDestroyVisual(Visual);
|
||||||
|
|
||||||
Visual = NULL;
|
Visual = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
* Written by Sean D'Epagnier (c) 2006
|
* Written by Sean D'Epagnier (c) 2006
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
int GpmMouse;
|
int GpmMouse;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int CurrentVT;
|
int CurrentVT = 0;
|
||||||
int ConsoleFD = -1;
|
int ConsoleFD = -1;
|
||||||
|
|
||||||
int KeyboardModifiers;
|
int KeyboardModifiers;
|
||||||
|
|
@ -529,14 +529,14 @@ static void VTSwitchHandler(int sig)
|
||||||
/* this is a hack to turn the cursor off */
|
/* this is a hack to turn the cursor off */
|
||||||
ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo);
|
ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo);
|
||||||
|
|
||||||
RestoreColorMap();
|
if(FixedInfo.visual != FB_VISUAL_TRUECOLOR)
|
||||||
|
RestoreColorMap();
|
||||||
|
|
||||||
Active = 1;
|
Active = 1;
|
||||||
Visible = 1;
|
Visible = 1;
|
||||||
VisibleSwitch = 1;
|
VisibleSwitch = 1;
|
||||||
|
|
||||||
Redisplay = 1;
|
Redisplay = 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,14 +72,13 @@ extern GLFBDevVisualPtr Visual;
|
||||||
#define REVERSECMAPSIZE (1<<REVERSECMAPSIZELOG)
|
#define REVERSECMAPSIZE (1<<REVERSECMAPSIZELOG)
|
||||||
|
|
||||||
extern unsigned short RedColorMap[256],
|
extern unsigned short RedColorMap[256],
|
||||||
GreenColorMap[256],
|
GreenColorMap[256],
|
||||||
BlueColorMap[256];
|
BlueColorMap[256];
|
||||||
extern unsigned char ReverseColorMap[REVERSECMAPSIZE]
|
extern unsigned char ReverseColorMap[REVERSECMAPSIZE]
|
||||||
[REVERSECMAPSIZE]
|
[REVERSECMAPSIZE]
|
||||||
[REVERSECMAPSIZE];
|
[REVERSECMAPSIZE];
|
||||||
void LoadOldColorMap(void);
|
|
||||||
void LoadColorMap(void);
|
void LoadColorMap(void);
|
||||||
void UnloadColorMap(void);
|
|
||||||
void RestoreColorMap(void);
|
void RestoreColorMap(void);
|
||||||
|
|
||||||
/* --- mouse --- */
|
/* --- mouse --- */
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
* Written by Sean D'Epagnier (c) 2006
|
* Written by Sean D'Epagnier (c) 2006
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue