@@ -290,13 +290,9 @@ void renderThreadp(
290
290
bool * record = nullptr ,
291
291
Shape* dn = nullptr ) {
292
292
// PREPARE RECORD
293
- const char recordOutput[]{ " ./tmp" };
294
- if (!std::filesystem::exists (recordOutput)) {
295
- std::filesystem::create_directory (recordOutput);
296
- }
297
293
bool preco = (record != nullptr ? *record : false ),
298
294
featureRec = record != nullptr ;
299
- std::vector <Texture> records;
295
+ std::queue <Texture> records;
300
296
// END PREPARE RECORD
301
297
302
298
// GL CONTEXT
@@ -316,12 +312,13 @@ void renderThreadp(
316
312
window->setFramerateLimit (fps[preco ? 0 : 1 ]);
317
313
}
318
314
if (preco) {
319
- if (records. max_size () >= records.size () + 1 ) {
315
+ if (10000 >= records.size () + 1 ) {
320
316
sf::Vector2u windowSize = window->getSize ();
321
317
sf::Texture texture;
322
318
texture.create (windowSize.x , windowSize.y );
323
319
texture.update (*window);
324
- records.push_back (texture);
320
+ records.push (texture);
321
+ // records.push_back(texture);
325
322
}
326
323
else
327
324
*record = false ;
@@ -361,8 +358,9 @@ void renderThreadp(
361
358
unsigned char * calced = (unsigned char *)malloc (sizevid * 3 );
362
359
VideoCapture vc;
363
360
vc.Init (size[0 ], size[1 ], 24 , 400000 );
364
- for (unsigned int x{ 0 }; x < records.size (); x++) {
365
- Image i = records[x].copyToImage ();
361
+ while (records.size () > 0 ) {
362
+ Image i = records.front ().copyToImage ();
363
+ records.pop ();
366
364
const unsigned char * ux = i.getPixelsPtr ();
367
365
// RGBA TO RGB:
368
366
for (size_t xr{ 0 }, xct{ 0 }, srx{ 0 }; xr < (sizevid * 4 ); xr++) {
0 commit comments