Package com.epsilon5.client.window

Examples of com.epsilon5.client.window.Window


import com.epsilon5.client.window.Window;

public class App {

    public static void main(String[] args) {
        final Injector injector = Guice.createInjector(new AppModule());
        final Window window = injector.getInstance(Window.class);
        window.show();

        final NetworkChannel channel = injector.getInstance(NetworkChannel.class);
        channel.open();
View Full Code Here


    public static void main(String[] args) {
        final Injector injector = Guice.createInjector(new AppModule());
        final Window window = injector.getInstance(Window.class);
        window.show();

        final NetworkChannel channel = injector.getInstance(NetworkChannel.class);
        channel.open();
    }
View Full Code Here

    public void setChannel(Channel channel) {
        this.channel = channel;
    }

    public void sendAuth() {
        final PlayerSettings settings = injector.getInstance(PlayerSettings.class);

        final Protocol.Auth message = Protocol.Auth.newBuilder()
                .setName(settings.getName())
                .setPassword(settings.getPassword())
                .build();

        logger.trace("Auth message is sent, {}", message);
        channel.write(message);
    }
View Full Code Here

    public void configure(Binder binder) {
        try {
            final JAXBContext context = JAXBContext.newInstance(Settings.class, World.class);
            final Unmarshaller um = context.createUnmarshaller();

            final Settings settings = (Settings) um.unmarshal(new File("description/settings.xml"));
            binder.bind(WindowSettings.class).toInstance(settings.getWindow());
            binder.bind(NetworkSettings.class).toInstance(settings.getNetwork());
            binder.bind(PlayerSettings.class).toInstance(settings.getPlayer());

            final World world = (World) um.unmarshal(new File("description/world.xml"));
            binder.bind(Sprites.class).toInstance(world.getSprites());

        } catch (JAXBException e) {
View Full Code Here

public class App {

    public static void main(String[] args) {
        final Injector injector = Guice.createInjector(new AppModule());
        final Window window = injector.getInstance(Window.class);
        window.show();

        final NetworkChannel channel = injector.getInstance(NetworkChannel.class);
        channel.open();
    }
View Full Code Here

        }
        this.currentWorld = currentWorld;
    }

    private void draw(GL2ES2 gl, Drawable drawable) {
        final Sprite sprite = sprites.get(drawable.getSpriteId());
        final Texture texture = textures.get(drawable.getSpriteId());
        texture.bind(gl);

        final int paddingRight = sprite.getPaddingRight() == null ? 0 : sprite.getPaddingRight();
        final int paddingBottom = sprite.getPaddingBottom() == null ? 0 : sprite.getPaddingBottom();

        if (CHECK_DRAWING_SEQUENCE) {
            if (lastLayer >= drawable.getLayer()) {
                lastLayer = drawable.getLayer();
            } else {
                throw new IllegalStateException();
            }
        }

        matrix.glPushMatrix();
        matrix.glTranslatef(
                drawable.getX() - (sprite.getWidth() - paddingRight) / 2,
                drawable.getY() - (sprite.getHeight() - paddingBottom) / 2,
                0);
        matrix.glScalef(sprite.getWidth(), sprite.getHeight(), drawable.getLayer());
        shader.uniform(gl, uniformData);

        gl.glDrawElements(GL2ES2.GL_TRIANGLES,
                elementsBuffer.getComponentCount() * elementsBuffer.getElementCount(),
                elementsBuffer.getComponentType(), elementsBuffer.getVBOOffset());
View Full Code Here

            final Settings settings = (Settings) um.unmarshal(new File("description/settings.xml"));
            binder.bind(WindowSettings.class).toInstance(settings.getWindow());
            binder.bind(NetworkSettings.class).toInstance(settings.getNetwork());
            binder.bind(PlayerSettings.class).toInstance(settings.getPlayer());

            final World world = (World) um.unmarshal(new File("description/world.xml"));
            binder.bind(Sprites.class).toInstance(world.getSprites());

        } catch (JAXBException e) {
            binder.addError(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.epsilon5.client.window.Window

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.