- 博客(28)
- 资源 (18)
- 收藏
- 关注
原创 核动力机器人代码---input class based on glfw
#ifndef G_INPUT_INPUT_HPP#define G_INPUT_INPUT_HPP#if _MSC_VER > 1000#pragma once#endif#ifndef _g_lib_ //#error please define g lib#endif #include #include #include
2009-01-22 22:58:00 719
原创 我设计的glfw按键检测类和其回调函数
一直想找个基于opengl的utilit好做游戏引擎 这几天看见了glfw,感觉不错 代码如下:class KeyEvent{public: KeyEvent(){} static void GLFWCALL keyfun( int _key, int action) { if( action != GLFW_PRESS )
2009-01-22 21:18:00 3302
原创 核动力机器人的代码-资源和资源管理器
/* ccdu20004@yahoo.com.cn 1.21.2009*/#ifndef G_RESOURCEMANAGER_HPP#define G_RESOURCEMANAGER_HPP #include #include #include #include "gexception.hpp"#include "gtrino
2009-01-21 23:33:00 758
原创 本人写的trinode模板-就是3叶节点
本人写的trinode模板-就是3叶节点 如下 欢迎评论,方便本人修改 代码如下: #ifndef G_GSTL_TRINODE_HPP#define G_GSTL_TRINODE_HPP#if _MSC_VER > 1000#pragma once#endif #include "math.hpp"#ifdef _MSC_
2009-01-21 22:47:00 806
原创 zthread线称队列
#ifndef TQUEUE_HPP#define TQUEUE_HPP#include #include "zthread/Thread.h"#include "zthread/Condition.h"#include "zthread/Mutex.h"#include "zthread/Guard.h"template class TQueue { /
2009-01-20 21:23:00 1155
原创 zthread线程的协作
ztrehead中线程协作的基类是condition —_—在处理的时候 可以通过wait挂起任务 通过signal唤醒任务 或者是broadcast #pragma comment(lib,"ZThread_Z.lib")#include #include #include "zthread/Thread.h"#include "zthread/Mutex.h"
2009-01-20 20:58:00 1366
翻译 glfw若干函数列表2
关于扩展支持一个扩展包含3个部分1.名字2.标记3.函数int glfwExtensionSupported( const char *extension )Fetching Function Pointersvoid * glfwGetProcAddress( const char *procname ) Function pointer type defi
2009-01-20 20:25:00 1034
原创 zthread中断和阻塞
1. 中断代码如下:#include #include "zthread/Thread.h"using namespace ZThread;using namespace std;class Blocked : public Runnable {public: void run() { try { Thread::sleep(1000);
2009-01-19 21:53:00 2742
翻译 glfw若干函数列表
1. int glfwInit( void ) 返回值 GL_TRUE 或者 GL_FALSE2. void glfwTerminate( void )屏幕设置3. int glfwOpenWindow( int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depth
2009-01-19 21:12:00 8861
翻译 GLFW简介
GLFW is a portable API (Application Program Interface) that handles operating system specific tasks related to OpenGLTM programming. While OpenGLTM in general is portable, easy to use and often result
2009-01-18 22:56:00 2643
原创 设计模式3:抽象工厂
看看抽象工厂 感觉迷迷糊糊的 上上网 看看例子随便写写 也不知道自己写的是不是一个抽象工厂的例子 嘿嘿如下:#include using namespace std; class person{public: virtual void eat(){cout<<"人吃饭"<<endl;} virtual void jump(){cout<<"人
2009-01-18 18:54:00 551
原创 zthread的使用9:生产者和消费者
#include #include #pragma comment(lib,"ZThread_Z.lib")#include #include #include #include "zthread/Thread.h"#include "zthread/Mutex.h"#include "zthread/Guard.h"#include "zthread/Co
2009-01-18 11:48:00 4971 1
原创 zthread的使用8:guardedclass类
zthread库提供了一个guardedlcass模板来自动为整个类创建同步封装器,来保证该类的每个成员函数将被自动保护 如下所示: #include #include #pragma comment(lib,"ZThread_Z.lib")using namespace ZThread;class MYclass{public: void f1(){
2009-01-18 11:19:00 937
原创 boost学习之function
先发下超越Boost库中的一个代码#include #include "boost/function.hpp"bool some_func(int i ,double d){ return i>d;}int main(){ boost::function f; f=&some_func; std::cout<<f(1,2.0)<<std::
2009-01-17 22:32:00 529
原创 boost静态断言
使用boost静态断言可以在编译的时候发现断言失败的问题#include templatevoid fun(){ BOOST_STATIC_ASSERT(i>1 && i<10);}int main(){ fun(); fun(); return 1; } 这是断言函数的参数范围 当然也可以断言模板实例化的类型
2009-01-17 21:55:00 986 1
原创 zthread多线程库的使用7: guard的问题
给出2个例子 #include #include #include "zthread/guard.h"#include "zthread/mutex.h"using namespace ZThread;using namespace std;#pragma comment(lib,"ZThread_D.lib")class tempCock{
2009-01-17 17:59:00 1616
原创 zthread多线程库的使用6 Cancelable 类与访问控制
类canceable的作用是提供一个通用的接口 通过它 可以来改变线程的状态通过isCancelable来获取线程的状态class MyCancel : public ZThread::Cancelable { bool canceled;public: MyCancel() : canceled(false) {} virtual void Go()=0;
2009-01-17 17:24:00 1480
原创 zhtread c++多线程库的使用5: 线程的本地化存储
消除线程在共享资源上的冲突的一个办法是消除共享的资源变量 ,因而就可以对同一对象的不同线程分配不同的存储单元 这是由threadloca模板来实现的 如下所示 #include #include "zthread/Thread.h"#include "zthread/Mutex.h"#include "zthread/Guard.h"#include "zthr
2009-01-17 17:08:00 1206
原创 photon游戏引擎代码例子2
该篇是介绍photon引擎中的Task类与其管理器类代码如下://This file is part of g lib#ifndef G_GOAL_TASK_HPP#define G_GOAL_TASK_HPP#ifndef _G_LIB_ #error please defie _G_LIB_#endif #include #include na
2009-01-17 15:15:00 959
原创 photon游戏引擎代码例子
上周下载了phonton游戏引擎, 接下来看看了 本来想run下,只是可惜少一个头文件,也懒的去找就顺势看了看其中的有些代码感觉在编程中可以使用得到,特意写下,当然按照本人风格,做了一些变动 :)//this file come from photon game engine//but modified it.#ifndef G_EXCEPTIONS_HPP#defin
2009-01-17 13:30:00 1367
原创 zhtread c++多线程库的使用4:资源问题
这是thread使用引用计数模板来处理多线程访问共享资源 的问题 #include #include #include #include #pragma comment(lib,"ZThread_Z.lib")class Count{enum {s =100};int n[s];public: void increment() {
2009-01-14 21:49:00 1012
原创 zhtread c++多线程库的使用3
今天公司请客吃饭 回来较晚 少些一点1关于线程优先权的问题若有线程优先权 那么在使用的时候线程调度器就倾向于优先执行级别较高的线程#include #include #include #pragma comment(lib,"ZThread_Z.lib")class thread : public ZThread::Runnable{public: thread(int _id): id(
2009-01-13 23:10:00 1048
原创 zhtread c++多线程库的使用2
按照c++ think上面的说明继续看看写个代码如下:编程环境(vc 7.1) #include #include #include #pragma comment(lib,"ZThread_Z.lib")class thread : public ZThread::Runnable{public: thread(int _id): id(_id){} ~thread(){} v
2009-01-12 22:08:00 2282
原创 zhtread c++多线程库的使用
很早就买了c++编程思想第二卷这本书 可惜最后一章一直没有看。于是找个时间看看多线程也比较好啊 使用编译好的zthread库自己先写个简短的例子:如下:#include #include #pragma comment(lib,"ZThread_Z.lib")class thread : public ZThread::Runnable{public: thread(int _id): id
2009-01-11 15:34:00 1739
原创 opengl/glut的若干函数
一直对opengl有兴趣,可是到现在还是略懂而已。现在才算是明白如何把opengl那套原始的屏幕坐标转换为我所熟悉的坐标系统先弄个小例子#include #include void init(void){ glClearColor (0.5, 0.5, 0.0, 0.0); glShadeModel (GL_SMOOTH); glLoadIdentity(); gluOrtho2D
2009-01-11 11:49:00 640
原创 c++设计模式2:命令行模式
这是我在c++思考第二卷见到的例子如下(做了一些改正);dev c++编程环境 #include #include #include #include #include using namespace std;class Task{public: virtual void operation()=0; };class TaskRunner{public: static vo
2009-01-10 12:10:00 1040
原创 c++设计模式1:单态模板
工作半年,今天第一次把简单的单态模式使用到了工作之中(vc 2009)#include #include #include #include using namespace std;using namespace boost;template class T>class Singleton{public: static inline T* instance();private: S
2009-01-08 22:55:00 1441 2
原创 c++回调函数的使用
今天在公司 总算搞清楚了如何使用回调函数 回调函数就是一个通过函数指针调用的函数。一般被用来进行系统通知事件时使用如下:#include #include #include using namespace std;typedef void (_stdcall *MyFun)(int n, string str);class Call{private: MyFun myFun;public:
2009-01-04 20:46:00 650
自己写的音频sdk,包含解码编码以及音效
2013-09-13
盖莫音频引擎1.5.5
2010-06-24
GAudio 1.4.2 alpha音频引擎 gcc版本
2010-05-28
盖莫音频引擎1.4.2 vc版本
2010-05-28
盖莫音频引擎1.2.8
2010-04-27
盖莫游戏引擎2.1.1 part2
2010-04-19
GEngine2.1.1 part1
2010-04-19
3d游戏引擎GEngine2.1.1sdk
2010-04-19
盖莫游戏引擎2.1.0版本
2010-03-12
盖莫游戏音频引擎支持oog,mp3,wav格式,多线程流式播放,使用超级简便
2010-01-23
G3d游戏引擎的使用(俺的游戏引擎)
2009-06-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人