Skip to content

Commit

Permalink
Add warning for "pixel format not accelerated"
Browse files Browse the repository at this point in the history
  • Loading branch information
Scotsguy committed Feb 4, 2020
1 parent cdc3f7b commit 248760c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ use regex::Regex;

pub type Check = fn(&str) -> Option<(&str, String)>;

pub static PARSERS: [Check; 9] = [
pub static PARSERS: [Check; 10] = [
multimc_in_program_files,
server_java,
buildsystem_forge,
multimc_in_onedrive_managed_folder,
java_version,
major_java_version,
pixel_format_not_accelerated_win10,
id_range_exceeded,
out_of_memory_error,
java_architecture,
Expand Down Expand Up @@ -91,7 +92,7 @@ fn multimc_in_onedrive_managed_folder(log: &str) -> Option<(&str, String)> {
}
}

fn java_version(log: &str) -> Option<(&str, String)> {
fn major_java_version(log: &str) -> Option<(&str, String)> {
lazy_static! {
static ref RE: Regex =
Regex::new(r"Java is version (1.)??(?P<ver>6|7|9|10|11|12)+\..+,").unwrap();
Expand All @@ -104,6 +105,17 @@ fn java_version(log: &str) -> Option<(&str, String)> {
}
}

fn pixel_format_not_accelerated_win10(log: &str) -> Option<(&str, String)> {
const LWJGL_EXCEPTION: &str = "org.lwjgl.LWJGLException: Pixel format not accelerated";
const WIN10: &str = "Operating System: Windows 10";
if log.contains(LWJGL_EXCEPTION) && log.contains(WIN10) {
Some(("❗", "You seem to be using an Intel GPU that is not supported on Windows 10. \
You will need to install an older version of Java, [see here for help](https://github.com/MultiMC/MultiMC5/wiki/Unsupported-Intel-GPUs)".to_string()))
} else {
None
}
}

fn java_architecture(log: &str) -> Option<(&str, String)> {
const TRIGGER: &str = "Your Java architecture is not matching your system architecture.";
if log.contains(TRIGGER) {
Expand Down

0 comments on commit 248760c

Please sign in to comment.