.class public Lcom/badlogic/gdx/graphics/glutils/GLVersion;
.super Ljava/lang/Object;
.source "GLVersion.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;
    }
.end annotation


# instance fields
.field private a:I

.field private b:I

.field private c:I

.field private final d:Ljava/lang/String;

.field private final e:Ljava/lang/String;

.field private final f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

.field private final g:Ljava/lang/String;


# direct methods
.method public constructor <init>(Lcom/badlogic/gdx/Application$ApplicationType;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 1

    .line 38
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "GLVersion"

    .line 36
    iput-object v0, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->g:Ljava/lang/String;

    .line 39
    sget-object v0, Lcom/badlogic/gdx/Application$ApplicationType;->Android:Lcom/badlogic/gdx/Application$ApplicationType;

    if-ne p1, v0, :cond_0

    sget-object p1, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->GLES:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    iput-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    goto :goto_0

    .line 40
    :cond_0
    sget-object v0, Lcom/badlogic/gdx/Application$ApplicationType;->iOS:Lcom/badlogic/gdx/Application$ApplicationType;

    if-ne p1, v0, :cond_1

    sget-object p1, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->GLES:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    iput-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    goto :goto_0

    .line 41
    :cond_1
    sget-object v0, Lcom/badlogic/gdx/Application$ApplicationType;->Desktop:Lcom/badlogic/gdx/Application$ApplicationType;

    if-ne p1, v0, :cond_2

    sget-object p1, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->OpenGL:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    iput-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    goto :goto_0

    .line 42
    :cond_2
    sget-object v0, Lcom/badlogic/gdx/Application$ApplicationType;->Applet:Lcom/badlogic/gdx/Application$ApplicationType;

    if-ne p1, v0, :cond_3

    sget-object p1, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->OpenGL:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    iput-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    goto :goto_0

    .line 43
    :cond_3
    sget-object v0, Lcom/badlogic/gdx/Application$ApplicationType;->WebGL:Lcom/badlogic/gdx/Application$ApplicationType;

    if-ne p1, v0, :cond_4

    sget-object p1, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->WebGL:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    iput-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    goto :goto_0

    .line 44
    :cond_4
    sget-object p1, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->NONE:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    iput-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    .line 46
    :goto_0
    iget-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    sget-object v0, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->GLES:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    if-ne p1, v0, :cond_5

    const-string p1, "OpenGL ES (\\d(\\.\\d){0,2})"

    .line 48
    invoke-direct {p0, p1, p2}, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 49
    :cond_5
    iget-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    sget-object v0, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->WebGL:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    if-ne p1, v0, :cond_6

    const-string p1, "WebGL (\\d(\\.\\d){0,2})"

    .line 51
    invoke-direct {p0, p1, p2}, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    .line 52
    :cond_6
    iget-object p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->f:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    sget-object v0, Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;->OpenGL:Lcom/badlogic/gdx/graphics/glutils/GLVersion$Type;

    if-ne p1, v0, :cond_7

    const-string p1, "(\\d(\\.\\d){0,2})"

    .line 54
    invoke-direct {p0, p1, p2}, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1

    :cond_7
    const/4 p1, -0x1

    .line 56
    iput p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a:I

    .line 57
    iput p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->b:I

    .line 58
    iput p1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->c:I

    const-string p3, ""

    const-string p4, ""

    .line 63
    :goto_1
    iput-object p3, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->d:Ljava/lang/String;

    .line 64
    iput-object p4, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->e:Ljava/lang/String;

    return-void
.end method

.method private a(Ljava/lang/String;I)I
    .locals 4

    .line 88
    :try_start_0
    invoke-static {p1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0
    :try_end_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0

    return v0

    .line 90
    :catch_0
    sget-object v0, Lcom/badlogic/gdx/Gdx;->a:Lcom/badlogic/gdx/Application;

    const-string v1, "LibGDX GL"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Error parsing number: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string p1, ", assuming: "

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-interface {v0, v1, p1}, Lcom/badlogic/gdx/Application;->error(Ljava/lang/String;Ljava/lang/String;)V

    return p2
.end method

.method private a(Ljava/lang/String;Ljava/lang/String;)V
    .locals 5

    .line 68
    invoke-static {p1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object p1

    .line 69
    invoke-virtual {p1, p2}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object p1

    .line 70
    invoke-virtual {p1}, Ljava/util/regex/Matcher;->find()Z

    move-result v0

    const/4 v1, 0x2

    const/4 v2, 0x0

    if-eqz v0, :cond_2

    const/4 p2, 0x1

    .line 72
    invoke-virtual {p1, p2}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object p1

    const-string v0, "\\."

    .line 73
    invoke-virtual {p1, v0}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object p1

    .line 74
    aget-object v0, p1, v2

    invoke-direct {p0, v0, v1}, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a(Ljava/lang/String;I)I

    move-result v0

    iput v0, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a:I

    .line 75
    array-length v0, p1

    if-ge v0, v1, :cond_0

    const/4 p2, 0x0

    goto :goto_0

    :cond_0
    aget-object p2, p1, p2

    invoke-direct {p0, p2, v2}, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a(Ljava/lang/String;I)I

    move-result p2

    :goto_0
    iput p2, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->b:I

    .line 76
    array-length p2, p1

    const/4 v0, 0x3

    if-ge p2, v0, :cond_1

    goto :goto_1

    :cond_1
    aget-object p1, p1, v1

    invoke-direct {p0, p1, v2}, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a(Ljava/lang/String;I)I

    move-result v2

    :goto_1
    iput v2, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->c:I

    goto :goto_2

    .line 78
    :cond_2
    sget-object p1, Lcom/badlogic/gdx/Gdx;->a:Lcom/badlogic/gdx/Application;

    const-string v0, "GLVersion"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "Invalid version string: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-interface {p1, v0, p2}, Lcom/badlogic/gdx/Application;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 79
    iput v1, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a:I

    .line 80
    iput v2, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->b:I

    .line 81
    iput v2, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->c:I

    :goto_2
    return-void
.end method


# virtual methods
.method public a()I
    .locals 1

    .line 102
    iget v0, p0, Lcom/badlogic/gdx/graphics/glutils/GLVersion;->a:I

    return v0
.end method
