Page 1 of 1

C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 1:21 pm
by wizard4
I did wonder if Irrlicht will compile with c++98 set. I'll see eventually. Noie has grabbed my attention. c++98 is a little old school and dated, a lot like the PlayStation 1 and BBC Micro.

I read my old C++ book. World of Books is actually a good web site for pre-dated, old books. I also grabbed some audio sampling books from WoB that sit on my shelf. They even cost a few £££.

Can I ask someone who uses ANSI 98 to run this code?

Code: Select all

#include <iostream>
#include <iomanip>

struct address
{
	char* pname;
	long zip;
};

int main()
{
	address jd;
	jd.pname = "Jim";
	jd.zip = 777;
	
	std::cout << std::setw(5) << jd.name << '|'
		<< std::setw(5) << jd.zip << '|';
	
	std::cout << "\n\n";
	return 0;
}
What was the output? Mine was

Code: Select all

     |  777|
Setting -std=c++98 will give me a warning that sting to char* conversion is forbidden. It's right here in my book that I can. Has g++ remembered everything pre-2000 to 2025?

Did Noie use a compiler from a CD? Is he using TurboC++ or some old, old archive? Can he get Irrlicht to work with it?

:D :D :D

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 2:00 pm
by Noiecity
in devc++ you can use irrlicht 1.3
https://sourceforge.net/projects/devpak ... ang%200.6/
(devc++ comes with many settings disabled, such as the line counter, and by default uses c++98)

https://sourceforge.net/projects/dev-cp ... e/download

(work fine with Wine in Linux)

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 2:12 pm
by wizard4
I see a 1.3 zip and also a 1.3.NET version. If that's the version that works with your set up. I'd have to give it a go to see. Fingers to keys I mean. You're actually dating back to hybrid's and Niko's time and when Irrlicht had 200+ members online.

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 2:28 pm
by Noiecity
wizard4 wrote: Mon Jan 20, 2025 2:12 pm I see a 1.3 zip and also a 1.3.NET version. If that's the version that works with your set up. I'd have to give it a go to see. Fingers to keys I mean. You're actually dating back to hybrid's and Niko's time and when Irrlicht had 200+ members online.
you need click to this link, sorry:
https://sourceforge.net/projects/devpak ... k/download

Install and use
Image

Image

Image

To use timers you can use the windows library and include it in the header <windows.h> .

Sleep(20); //await 20 milliseconds

DWORD startTime = GetTickCount(); //take the start time
DWORD endTime = GetTickCount(); //take the elapsed time from the initial time in milliseconds

In the windows.h library there are other timers based on processor cycles or something like QueryPerformanceCounter and QueryPerformanceFrequency, it also has SetTimer and KillTimer to create and destroy timers...

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 3:04 pm
by Noiecity
Interesting, it only occupies 3% of the GPU in each frame if I limit it to 25 FPS, without the limit 65%, while the visual studio versions occupies 100% of the gpu in each frame(Although I have not seen it limited to 25 FPS). In fact the software renderer version occupies 0% of the CPU(25 FPS), that is to say that the consumption is extremely low(although this is due to the 640x480 resolution, in 800x600 it occupies 10%).

Code: Select all

#include <irrlicht.h>
#include <windows.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

#pragma comment(lib, "Irrlicht.lib")

int main()
{
	/*
	   EDT_NULL, EDT_DIRECT3D8 , EDT_DIRECT3D9, or EDT_OPENGL. 
	*/

	IrrlichtDevice *device =
		createDevice(EDT_SOFTWARE, dimension2d<s32>(640, 480), 16,
			false, false, false, 0);

	device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");


	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	IGUIEnvironment* guienv = device->getGUIEnvironment();


	guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!",
		rect<int>(10,10,200,22), true);

	IAnimatedMesh* mesh = smgr->getMesh("../../Examples/irrlicht/media/sydney.md2");
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );


	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setFrameLoop(0, 310);
		node->setMaterialTexture( 0, driver->getTexture("../../Examples/irrlicht/media/sydney.bmp") );
	}


	smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));


	while(device->run())
	{

		Sleep(40);//1000:40=25
		driver->beginScene(true, true, SColor(255,100,101,140));

		smgr->drawAll();
		guienv->drawAll();

		driver->endScene();
		
	}

	device->drop();

	return 0;
}

Modern versions usually have a high performance by taking full advantage of the capacity of the graphics card, in my case I prefer a high performance but without spending too many resources.

I wonder if there is any way to bring the new versions of irrlicht to devc++....

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 3:17 pm
by wizard4
A minor issue...

I had 1.9GB space available, 26GB was taken (a bit of a shock) but after wine was installed I have 0000000.000 bytes free. My computer is rammed full.

My laptop is a second hand 110S that was taken out of safe mode anyway, but booted Windows in seconds. I was very impressed. Linux Mint on the other hand loads slowly, about a minute, with an "out of txt area" message, which could be the boot order.

I'm going to have to try install Mint once again, try and make it small, or maybe try Ubuntu. I know of SuSE and Debian. I haven't tried any others.

Thanks :)

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 3:31 pm
by Noiecity
Try older versions, modern versions are optimized for modern graphics cards or CPU's. Also older versions of Wine are much lighter, in fact Wine version 1.6.2 was its last test for devc++ 4.9. Try ubuntu 14.04
https://www.releases.ubuntu.com/14.04/

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 5:09 pm
by wizard4
Does the word "security" mean anything to you?

Once my monitor blinked black for a few seconds and my first thought was, "hacker!"

I can give it a go. Plus only takes up 6 GB.

I did see Lubuntu. What's your thoughts on that?

Re: C98 works with Irrlicht?

Posted: Mon Jan 20, 2025 5:26 pm
by Noiecity
wizard4 wrote: Mon Jan 20, 2025 5:09 pm Does the word "security" mean anything to you?

Once my monitor blinked black for a few seconds and my first thought was, "hacker!"

I can give it a go. Plus only takes up 6 GB.

I did see Lubuntu. What's your thoughts on that?
I think Lubuntu is beautiful. By the way, modern antivirus catches almost any program as a virus(an empty window even), I have written in assembly something basic and it still detects it as suspicious(false positive), so... if you ever make a commercial program, you will have to contact many antivirus.

Re: C98 works with Irrlicht?

Posted: Tue Jan 21, 2025 1:58 pm
by wizard4
I will organise my folders to get Sydney...

First test
[web site gone]

Then package test

Lubuntu 24.04 did the job

Re: C98 works with Irrlicht?

Posted: Tue Jan 21, 2025 2:29 pm
by Noiecity
wizard4 wrote: Tue Jan 21, 2025 1:58 pm I will organise my folders to get Sydney...

First test
Image

Then package test
Image

Lubuntu 24.04 did the job
try chmod 644 sydney.md2 (with the terminal), or try "winecfg"(with the terminal), in the Wine configuration window, go to the "Drives" tab, click on "Add", in the dialog that appears, select a drive letter (e.g., Z:) and in the "Path" field, enter the Linux path you want to mount. For example, if your sydney.md2 file is in /home/user/documents/devs/HellWorldRichCase, enter /home/user/documents/devs/HellWorldRichCase, click "OK" to add the drive, if you assigned Z: to /home/user/documents/devs/HellWorldRichCase, you can access the sydney.md2 file using the path Z:/sydney.md2, in this case, for Z:/example/example1/irrtest.exe the relative path is ../../sydney.md2

Re: C98 works with Irrlicht?

Posted: Wed Jan 22, 2025 9:22 am
by wizard4
Works well. I was at the library yesterday evening. It's my goal to go more often and cut right down on cafe visits. I worked on a Bank / Bill / Calendar system that I'm struggling to visualise. Instead of having redefinition header errors or many classes to work with, I've settled on getting Bank and Bill to communicate before trying a Calendar class. I wanted to insert bills into the calendar that checks the bill date and reduces bank.

Thus so far I have a spaghetti mess.

What I liked about Bjarne's calculator, he tried a few attempts (don't forget that) but when the part came to checking input in a switch, suddenly everything clicked in place. It was down to the set up before.