Skip to content

Instantly share code, notes, and snippets.

@Tom-Ski
Tom-Ski / SSLTest.java
Created December 14, 2021 16:06
SSL server name issue
package com.asidik.test;
import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
Index: backends/gdx-backend-android/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- backends/gdx-backend-android/build.gradle (date 1533542459000)
+++ backends/gdx-backend-android/build.gradle (date 1533661568195)
@@ -15,5 +15,5 @@
******************************************************************************/
@Tom-Ski
Tom-Ski / AndroidLauncher.java
Created September 26, 2017 01:44
Simple Libgdx + Android camera
package com.mygdx.game;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.os.Bundle;
import android.view.SurfaceView;
import android.view.View;
import android.widget.FrameLayout;
import com.badlogic.gdx.Gdx;
public FileHandle saveFrameBuffer (FrameBuffer frameBuffer) {
FileHandle handle = Gdx.files.external("myscreenshot.png");
frameBuffer.bind();
Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Pixmap.Format.RGBA8888);
ByteBuffer pixels = pixmap.getPixels();
Gdx.gl.glReadPixels(0, 0, frameBuffer.getWidth(), frameBuffer.getHeight(), GL20.GL_RGBA, GL20.GL_UNSIGNED_BYTE, pixels);
try {
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.Cubemap;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.PerspectiveCamera;
@Tom-Ski
Tom-Ski / build.gradle
Last active February 7, 2017 21:52
lwjgl3 override
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile ("com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion") {
exclude group: "org.lwjgl"
}
@Tom-Ski
Tom-Ski / Animation.java
Created April 26, 2014 20:48
Old Timeline
public FfdTimeline (int frameCount) {
super(frameCount);
frames = new float[frameCount];
frameVertices = new float[frameCount][];
}
public void setSlotIndex (int slotIndex) {
this.slotIndex = slotIndex;
}
package me.tomski.blobrun.desktop;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;