Skip to content

Instantly share code, notes, and snippets.

#include <Gl/glut.h>
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glRotatef(50,1,0,1);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glBegin(GL_QUADS);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.5, 0.0, 0.0);
glVertex3f(0.5, 0.5, 0.0);
#include<GL/glut.h>
GLfloat xRotated,yRotated,zRotated;
GLfloat l,r,b,t;
void idle(){
glutPostRedisplay();
}
void display(){
glMatrixMode(GL_MODELVIEW);
/*
* Copyright (C) 2014 darnmason
*
* 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
public void addFragmentMenu(Bundle savedInstanceState){
if(savedInstanceState == null) {
Fragment mMenu = new MenuFragment();
FragmentManager mFragmentManager = getSupportFragmentManager();
FragmentTransaction mFragmentTransaction = mFragmentManager.beginTransaction();
// R.id.container is a layout that contain fragment
mFragmentTransaction.add(R.id.frgcnt, mMenu);
mFragmentTransaction.commit();
}
}
@blkrt
blkrt / getHeight.java
Created July 10, 2016 13:55
Android --> get Height And Width a Layout Or View
view.post(new Runnable() {
@Override
public void run() {
int width = view.getWidth();
int height = view.getHeight();
//do something cool with width and height
}
});
/**
*
* @param MAIN CLASS
*/
public class CrunchifyObjectTest {
static Singleton instance = Singleton.getCrunchifySingletonInstance();
public static void main(String[] args) {
/*
* Copyright (C) 2015 Square, Inc.
*
* 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
package com.cy.retrofithttpstest;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.cy.retrofithttpstest.retrofit.ToStringConverterFactory;
import com.zhy.http.okhttp.OkHttpClientManager;