• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GLua_CheckBitStream函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GLua_CheckBitStream函数的典型用法代码示例。如果您正苦于以下问题:C++ GLua_CheckBitStream函数的具体用法?C++ GLua_CheckBitStream怎么用?C++ GLua_CheckBitStream使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GLua_CheckBitStream函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GLua_BitStream_Index

static int GLua_BitStream_Index(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	const char *key = lua_tostring(L,2);
	GLUA_UNUSED(stream);
	lua_getmetatable(L,1);
	lua_getfield(L,-1,key);
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:8,代码来源:glua_bitstream.cpp


示例2: GLua_BitStream_ToString

static int GLua_BitStream_ToString(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	if (stream->reading) {
		lua_pushstring(L,va("BitStream [ Reading - %i / %i bytes ]", stream->stream.readcount, stream->stream.maxsize ));
	} else {
		lua_pushstring(L,va("BitStream [ Writing - %i / %i bytes ]", stream->stream.cursize, stream->stream.maxsize ));
	}
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:9,代码来源:glua_bitstream.cpp


示例3: GLua_BitStream_GetData

static int GLua_BitStream_GetData(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	
	if (stream->reading) {
		lua_pushlstring(L, stream->data, stream->stream.maxsize);
	} else {
		lua_pushlstring(L, stream->data, stream->stream.cursize);
	}
	return 1;
}
开发者ID:Stoiss,项目名称:JediKnightGalaxies,代码行数:10,代码来源:glua_bitstream.c


示例4: GLua_BitStream_Reset

static int GLua_BitStream_Reset(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	if (stream->reading) {
		BitStream_BeginReading(&stream->stream);
	} else {
		stream->stream.cursize = 0;
		stream->stream.bit = 0;
	}
	return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp


示例5: GLua_BitStream_GetLength

static int GLua_BitStream_GetLength(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	
	if (stream->reading) {
		lua_pushinteger(L, stream->stream.maxsize);
	} else {
		lua_pushinteger(L, stream->stream.cursize);
	}
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp


示例6: GLua_BitStream_BytesRemaining

static int GLua_BitStream_BytesRemaining(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	
	if (stream->reading) {
		lua_pushinteger(L, stream->stream.maxsize - stream->stream.readcount);
	} else {
		lua_pushinteger(L, stream->stream.maxsize - stream->stream.cursize);
	}
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp


示例7: GLua_BitStream_GetData

static int GLua_BitStream_GetData(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	
	if (stream->reading) {
		lua_pushlstring(L, reinterpret_cast<const char *>(stream->data), stream->stream.maxsize);
	} else {
		lua_pushlstring(L, reinterpret_cast<const char *>(stream->data), stream->stream.cursize);
	}
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:10,代码来源:glua_bitstream.cpp


示例8: GLua_BitStream_WriteUInt

static int GLua_BitStream_WriteUInt(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	unsigned int val = luaL_checkinteger(L,2);
	
	if (stream->reading) {
		luaL_error(L, "Attempted to write to a read-only bitstream");
		return 0;
	}

	BitStream_WriteUInt(&stream->stream, val);
	
	return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp


示例9: GLua_BitStream_WriteBool

static int GLua_BitStream_WriteBool(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	int val = lua_toboolean(L,2);
	
	if (stream->reading) {
		luaL_error(L, "Attempted to write to a read-only bitstream");
		return 0;
	}

	BitStream_WriteBool(&stream->stream, val);
	
	return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp


示例10: GLua_BitStream_WriteString

static int GLua_BitStream_WriteString(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	const char *val = luaL_checkstring(L,2);
	
	if (stream->reading) {
		luaL_error(L, "Attempted to write to a read-only bitstream");
		return 0;
	}

	BitStream_WriteString(&stream->stream, val);
	
	return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp


示例11: GLua_BitStream_WriteDouble

static int GLua_BitStream_WriteDouble(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	double val = luaL_checknumber(L,2);
	
	if (stream->reading) {
		luaL_error(L, "Attempted to write to a read-only bitstream");
		return 0;
	}

	BitStream_WriteDouble(&stream->stream, val);
	
	return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:13,代码来源:glua_bitstream.cpp


示例12: GLua_BitStream_ReadDouble

static int GLua_BitStream_ReadDouble(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	double val;
	
	if (!stream->reading) {
		luaL_error(L, "Attempted to read from a write-only bitstream");
		return 0;
	}

	val = BitStream_ReadDouble(&stream->stream);
	
	lua_pushnumber(L, val);
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:14,代码来源:glua_bitstream.cpp


示例13: GLua_BitStream_ReadUInt

static int GLua_BitStream_ReadUInt(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	unsigned int val;
	
	if (!stream->reading) {
		luaL_error(L, "Attempted to read from a write-only bitstream");
		return 0;
	}

	val = BitStream_ReadUInt(&stream->stream);
	
	lua_pushinteger(L, val);
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:14,代码来源:glua_bitstream.cpp


示例14: GLua_BitStream_ReadBool

static int GLua_BitStream_ReadBool(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	int val;
	
	if (!stream->reading) {
		luaL_error(L, "Attempted to read from a write-only bitstream");
		return 0;
	}

	val = BitStream_ReadBool(&stream->stream);
	
	lua_pushboolean(L, val);
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:14,代码来源:glua_bitstream.cpp


示例15: GLua_BitStream_ReadString

static int GLua_BitStream_ReadString(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	luaL_Buffer B;
	char ch;
	
	if (!stream->reading) {
		luaL_error(L, "Attempted to read from a write-only bitstream");
		return 0;
	}

	luaL_buffinit(L, &B);
	while (1) {
		ch = BitStream_ReadChar(&stream->stream);
		if (!ch) {
			break;
		}
		luaL_addchar(&B, ch);
	}
	luaL_pushresult(&B);
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:21,代码来源:glua_bitstream.cpp


示例16: GLua_BitStream_WriteData

static int GLua_BitStream_WriteData(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	unsigned int length;
	unsigned int deslength;
	const char *val = luaL_checklstring(L,2, &length);

	if (!lua_isnoneornil(L,3)) {
		deslength = luaL_checkinteger(L,3);
		if (length < deslength) {
			luaL_error(L, "BitStream_WriteData: Specified length is less than data length");
		}
		length = deslength;
	}
	
	if (stream->reading) {
		luaL_error(L, "Attempted to write to a read-only bitstream");
		return 0;
	}

	BitStream_WriteData(&stream->stream, (const unsigned char *)val, length);
	
	return 0;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:23,代码来源:glua_bitstream.cpp


示例17: GLua_BitStream_GetMaxLength

static int GLua_BitStream_GetMaxLength(lua_State *L) {
	GLua_Bitstream_t *stream = GLua_CheckBitStream(L, 1);
	
	lua_pushinteger(L, stream->stream.maxsize);
	return 1;
}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:6,代码来源:glua_bitstream.cpp



注:本文中的GLua_CheckBitStream函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GLuint函数代码示例发布时间:2022-05-30
下一篇:
C++ GLsizei函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap