C++ :: Port A Pc Game To Android
Jul 10, 2013How do I port a pc game to android? Do I just include libraries or do I have to rewrite all my code?
View 5 RepliesHow do I port a pc game to android? Do I just include libraries or do I have to rewrite all my code?
View 5 RepliesI am trying to write a c file to decompress jpeg images in android aokp source
Sample from my c code:
...
#include "jpeglib.h"
...
int main() {
struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
[Code] ....
libjpeg source I am using: [URL] ....
Compiling goes fine, but the linker always fails:
undefined reference to 'jpeg_std_error'
undefined reference to 'jpeg_CreateDecompress'
How can I get it working?
I'm working on my first video game. So far I have a few classes in the game starting with the Game class which includes a list of GameObjects (another class). There are several classes that inherit from GameObjects used to implement things like bullets, explosions, various enemy types, etc.
The game essentially iterates through the list of GameObjects to update/render them. I would like to provide access to the Game's list of GameObjects inside another class (like the Bullet class) so I can put new objects on the list. For example, when a bullet hits, I want to add an explosion to the Game's GameObject list it can be updated/rendered.
How this should be setup? I was considering adding a pointer to the Game or GameObject list to the GameObject class (and methods to access it), but I was wondering if there is a better way to set this up?
I would like to make a program for calculating the total price of a game station, and a game. I made a program like this for just the price of a game in class, but I want to make one that does the game system as well.
View 7 Replies View RelatedI'm new in c programming and my requirement is as follows. I make a code for oss mixer and now when new systems, throwing the OSS, and there is no /dev/mixer I want to port my code to alsa but my skills are minimal.
Code:
static int mixer_fd = -1, mixer_src = -1;
static char *devices[] = SOUND_DEVICE_NAMES;
int mixer_init(char *mixer_device, char *mixer_source) {
int i;
mixer_src = -1;
for (i=0;i<SOUND_MIXER_NRDEVICES;i++)
if (strcmp(mixer_source, devices[i]) == 0)
[Code] ....
Coexistance with OSS would be nice, so both could be used depending on users choice. Perhaps: if this first
part of the mixer name is a valid device file, try OSS, otherwise try ALSA?
I'm creating a small port scanning app which use a port range defined by user.My problem with the code is that I find it not efficient enough meaning that it ping very slow, especially when ports are not responding meaning that I must wait for the timeout before continuing to next port.
I want to make this small app threaded. The problem here is that I'm kind of blank of how to implement threading in my program. This is my code which is a method which does the actual checking, the other part of the code is a simple button with for loop for advancing my port number.
Code:
private void ScanPort(IPAddress address, int port) {
using (TcpClient client = new TcpClient() {
IAsyncResult result = client.BeginConnect(address, port, null, null);
if (result.AsyncWaitHandle.WaitOne((int)nudTimeout.Value, false)) txtDisplay.AppendText("Port: " + port + " is open." + Environment.NewLine);
else txtDisplay.AppendText("Port: " + port + " is closed." + Environment.NewLine);
} }
I have read some basic threading tutorial but I just don't know how to implement this piece of code so I can check ports much faster.
I try to ON and OFF the LED's via parallel port. I connect the cathode of LED's with pin number 18 that is ground and anode of each LED is connected through a 1K resistor to pin 2 to 8. I write the following programe
Code:
#include <dos.h>
#include <stdio.h>
#include <conio.h>
#define PORTID 0x378
void main(){
outportb(PORTID,0x00);
getch()
}
But when i connect the LEDS to the parallel port all the LEDS are LIT while i also change the 0x00 to 0xff and so on. But no effect on the LED's.
I started writing in c because I want to control relays with the parallel port, or anything else. Doesn't really matter what I use I just need to know where to start. Trying to send and receive data from the outside world with c programming on a GNU/Linux os? If so any good some what up to date resources online?
View 5 Replies View RelatedI am on a project. I have a laptop and It doesn't have a COM port. So what I would like to do is to get a usb to RS232 cable and write a code so to output voltages on usb and measure it on the RS-232 end. Can I vary the output voltage to my needs?
View 2 Replies View RelatedHow To write to the parallel port under windows xp using Visual C++ ->MS Studio studio 2005
View 4 Replies View RelatedHow to communicate my COM PORT to my visual c++ ... Means i want to read data from my port and want to show in visual c++ so what to do ...
View 1 Replies View RelatedI am trying to convert decimal value 1 to 32 to hex value and insert it at 4th pos of char array and send it as hex value at the serial port .
My issue is it is converting to decimal to hex value but when it sends, it treat the converted hex value as char and sends it equivalent hex value.
For example
if decimal =1 then its hex = 1.
so , writebuffer[3] =1
But when we send whole writebuffer through send function, it treat this 1 as char and sends its hex value as 31. how to send its hex value.
unsigned int i=0;
char hex[3];
unsigned char hexunsigned[3];
unsigned int dec;
do {
unsigned char writebuffer[8] ={0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
[Code] ....
The send function is
void serial::send(unsigned char data[], DWORD noOfByte) {
DWORD dwBytesWrite;
WriteFile(serialHandle, data, noOfByte, &dwBytesWrite, NULL);
}
How to send a keystroke or a mouse event to another running process in Ubuntu? I want to write a C program that reads data from the USB port sent by AVR Micro Controller board continuously.In response to that it checks the data received and sends a command to another process running on the computer? Example,when the program reads 101 from the USB port it sends left mouse button down to the VLC media player window that is currently running?
View 1 Replies View RelatedI habe a program, that can send and receive UDP Multicast telegrams. When I open the socket then I bind my multicast group address and the local port to a specified networkcard (our PC has 2 network cards). Now I have a special constellation:
Our PC has 2 network cards. Multicast group 1 shall use card 1 and group shall use card 2. As long as both groups use different local ports it works fine. But when both group want to use the same port number then I can receive and send telegrams only through the first group that was created. For the second one I don't even get a FD_READ event at all.
Code:
SrvAddr.sin_family = AF_INET;
SrvAddr.sin_port = htons( (WORD) nLocalPort );
SrvAddr.sin_addr.s_addr = inet_addr(strOwnIpAddress); // bind multicast group socket to a specified networkcard
// If bind socket to port failed
if( bind( hSocket,
[Code] .....
I am using libserial library to communicate through the serial port in c++. the linux cpu is communicating with a modem through the serial port. basically this is what i want to do
Code:
//I want:
cpu to write command_1 to modem
Wait for the answer from modem
read serial port
check if command successful (i.e modem sends OK if successful and ERROR if there is an error)
If there is an error, resend command_1
if successful then Write command_2 to modem Wait for answer read again serial port check if command is succesful (modem again sends OK if successful and ERROR if there is an error) basically, this is the code...
Code:
serial_port <<command_1 <<'
'; //send 1st command
sleep(2); //delay a while
[Code].....
I am trying to have a program that I am writing detect a controller and then say whether there is or is not one connected. But I am getting a lot of errors(25 actually) . Here is my code:
Code:
#include <stdio.h>
#include <Xinput.h>
#include <stdbool.h>
#include <Windows.h>
void main()
[Code] ....
puts("Error no controller was found on any port");
return 0;
}
I have a Voltage Range from -10V up to +10V, which I transform to a voltage Range 0V to 5V, with the schematic i've attached, so I can use the A/D converter of my ATMEGA32 processor.
Now I'd like to write the value of the Input Voltage (which moves in the Range of -10V to + 10V) on the serial port, but i don't know how i should calculate this factor. At the moment, I can only write the value of the A/D Converter Input on the serial, but this is only 0V to 5V...
Explain me a working code to read and write a file using serial communication.and i need to store that file.I know normal file handling in C, but how it is through serial port i am not getting.
View 1 Replies View RelatedI am trying to write data in Russian language to the serial (RS-232) port. My display device is already set to that character code page.
But output on the device is not exactly what I require.
My code snippet is like this below
CString pBuffer = L"английский"; //Russian Language
LPBYTE pByte = new BYTE[pBuffer.GetLength() + 1];
memcpy(pByte, (VOID*)LPCTSTR(pBuffer), pBuffer.GetLength());
long nBuffer=pBuffer.GetLength()+1;
DWORD dwWritten=0;
WriteFile(pHandle , pByte, nBuffer ,&dwWritten , NULL);
pHandle is a valid handle.
i want to read the string plus image from serialport.
sample output:
DENOMI Ver SERIAL NUMBER
100 V <<<<IMAGE>>>>
100 N <<<<IMAGE>>>>
but when im trying to receive the data and using serialPort.ReadExisting();
this is the output:
DENOMI Ver SERIAL NUMBER
100 V *!???????q??q??y??y?y?q?????????xxxxppppp????y?py?`q??q??q? q???????????????8?p8?@8??8?????????????8??8?p8?p?p??p??p?????????q?q?p8p88?p8?????????????8?p8?p8?p8?p8??8??x??x8?8?8??p?p??p??p0?py?p????????~8?q??q??q??p8?????p??????????????????????????????p8?x?x<?x<?x<??<?????
private void button1_Click(object sender, EventArgs e) {
serialPort1.PortName = "COM1";
serialPort1.BaudRate = 9600;
serialPort1.DataBits = 8;
serialPort1.Parity = Parity.None;
serialPort1.StopBits = StopBits.One;
[Code]...
In my project i have a serialport control and a button, there is no error but i want to know how actually this works, i want to send and recieve the data from the serial port don't know how to do it..
How can i read barcode scanner value from serial port?
View 5 Replies View RelatedI am doing a messaging application using Visual C++ window form application.
Sometimes I can't receive a whole message from the sender. If i type short sentence like "123456", it can be shown properly. But, if i type a quite long sentence like "123456789123456789", it can't shown a correct message, can't show exactly the whole message.
here is my code:
//transmission:
String^ message;
String^ message1;
String^ name = this->serialPort1->PortName;
[Code].....
I have this project and I already have a code and the circuit, but I studied assembly language it's supposed to display the hours and minutes.
Here's the code:
TITLE CLOCK.ASM
DOSSEG
.MODEL SMALL
.STACK 0100H
.DATA
PRINTERPORTBASEADDRESS equ 378h
[Code] ....
This is the circuit diagram [URL] ....
I want to read and write value on serail port to Microcontroller with MFC. The MFC have no serial port tool like in VB Professionnal edition. I try to find MFC connect serial port example but I not found. If you have good example for read and write on serial port with MFC
View 2 Replies View RelatedUse of the port series mode blocked under CBuilder RAD Communication with the robot to the Modbus Protocol, This is a c++ program which serves as a force a bit of %M65. And also to calculate the CRC16 at the end.
I supports M340 automaton.
I have not a force several bits at the same time
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "dddd.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
[code]....